refresh option on angular gauge
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



refresh option on angular gauge Expand / Collapse
Author
Message
Posted 7/30/2007 4:40:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/26/2007 9:02:07 AM
Posts: 8, Visits: 30
Hello.
I just start to use Fusion ch. and i've been working around with trial version from the site. I want to use the refresh option on
angular gauge. Question: the dataStreamURL must return the data in "&value=..." form ? I have a JSP page as dataStreamURL that returns the result in this form but does not refresh. After showing first value the dial returns to 0 and remains there.



Thanks!
Post #1757
Posted 7/30/2007 9:31:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/26/2007 9:02:07 AM
Posts: 8, Visits: 30
Hello.
The Get_updated_cpuload_latestval.jsp returns "&value=..." result.
This is my xml file gor the chart:

chart upperLimit="100" lowerLimit="0" gangeScaleAngle="180" gangeStartAngle="0" numberSuffix="%25" decimalPrecision="0" baseFontSize="10" dataStreamURL="Get_updated_cpuload_latestval.jsp?lowerLimit=0%26upperLimit=100" refreshInterval="8"
colorRange
color minValue="0" maxValue="20" code="FF0000" borderColor="FF0000" /
color minValue="20" maxValue="40" code="33CC33" borderColor="33CC33" /
color minValue="40" maxValue="60" code="0000FF" borderColor="0000FF" /
color minValue="60" maxValue="80" code="FF6600" borderColor="FF6600" /
color minValue="80" maxValue="100" code="9966CC" borderColor="9966CC" /
/colorRange
dials
dial value="6.5" bgColor="666666" radius="90" baseWidth="8" topWidth="2" /
/dials
trendpoints
point displayValue="13:45:36" value="6.5" /
/trendpoints
/chart

Is based on the doc's examples.But does not refresh.
Thanks!
Post #1762
Posted 7/30/2007 1:37:06 PM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 5/12/2008 6:29:47 AM
Posts: 1,772, Visits: 448
Can you make sure that JSP file:

  1. does NOT return any HTML tags
  2. does NOT add any carriage returns to output


Thanks,
Pallav Nadhani
FusionCharts Team
Post #1777
Posted 7/31/2007 2:51:06 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/26/2007 9:02:07 AM
Posts: 8, Visits: 30
Hello.
This is my jsp page(Get_updated_cpuload_latest.jsp):

<%@page import="java.util.Random"%>
<%
String latest_value = "";
Random rand = new Random();
latest_value = //String.valueOf(rand.nextInt(100));
"&value=" + String.valueOf(rand.nextInt(100));
%>
<%=latest_value%>

Is it good?

Thanks!
Post #1791
Posted 8/1/2007 4:11:59 PM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 5/12/2008 6:29:47 AM
Posts: 1,772, Visits: 448
Can you please paste the code of JSP inline?

Or, preferably just the output of the JSP. Also, another note when using JSP:

In order to get the output without addition of any carriage-returns or tab spaces, there should not be spaces or empty lines between scriptlet tags or at the end of the page.

Thanks,
Pallav Nadhani
FusionCharts Team

Post #1822
Posted 8/2/2007 3:42:12 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/26/2007 9:02:07 AM
Posts: 8, Visits: 30
Hello.
I've mode it work with this content of .jsp page(code):

&value=<%=(int)(Math.random()*100) %>

Now, I have to do this update based on a value from db; tried with this code:


<%@ page import="fusioncharts.util.Constants"%>
<%@ page import="java.sql.Statement"%>
<%@ page import="java.sql.ResultSet"%>
<%@page import="java.sql.Connection"%>
<% dbConn.setOracleDBPath("192.168.2.110:1521:orcl");
dbConn.setDbName("Oracle");
Connection conn = dbConn.getConnection();
Statement st1 = null;
ResultSet rs1 = null;
String strQuery = "";
int value = 0;
String animateChart = "";
if (null == animateChart || animateChart.equals("")) {
animateChart = "1";
}
String dbName = dbConn.getDbName();
if (dbName.equals(Constants.ORACLEDB)) {
strQuery = "select dt,val from view";
}
try {
st1 = conn.createStatement();
} catch (java.sql.SQLException e) {
System.out.println(e.getMessage());
}
rs1 = st1.executeQuery(strQuery);
while (rs1.next()) {
value = rs1.getInt("val");
}
try {
if (null != rs1) {
rs1.close();
rs1 = null;
}
} catch (java.sql.SQLException e) {
System.out.println("Could not close the resultset");
}
try {
if (null != st1) {
st1.close();
st1 = null;
}
} catch (java.sql.SQLException e) {
System.out.println("Could not close the statement");
}
try {
if (null != conn) {
conn.close();
conn = null;
}
} catch (java.sql.SQLException e) {
System.out.println("Could not close the connection");
}
%>&value=<%=(int) value%>

Does not refresh in this case.Is there another way to do this? Should I use JavaScript code?

Thanks!

Post #1830
Posted 8/2/2007 5:29:38 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/26/2007 9:02:07 AM
Posts: 8, Visits: 30
Hello.
Resolved it! It was an empty line at the end in my code that i didn't noticeit at first.
Thanks for suggestions.
Post #1832
Posted 5/5/2008 2:32:57 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Yesterday @ 8:55:49 PM
Posts: 5, Visits: 31
Yes, I would love to see the jsp example in the documentation "fixed" so that it actually works and reflects the exact syntax represented here that DOES work.
Post #6097
« Prev Topic | Next Topic »


Permissions Expand / Collapse