|
|
|
Forum 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!
|
|
|
|
|
Forum 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!
|
|
|
|
|
FusionCharts Team
      
Group: Administrators
Last Login: 5/12/2008 6:29:47 AM
Posts: 1,772,
Visits: 448
|
|
Can you make sure that JSP file:- does NOT return any HTML tags
- does NOT add any carriage returns to output
Thanks, Pallav Nadhani FusionCharts Team
|
|
|
|
|
Forum 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!
|
|
|
|
|
FusionCharts 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
|
|
|
|
|
Forum 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!
|
|
|
|
|
Forum 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.
|
|
|
|
|
Forum 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.
|
|
|
|