Sign in to follow this  
fusionchartsuser

refresh option on angular gauge

Recommended Posts

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!

Share this post


Link to post
Share on other sites

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!

Edited by Guest

Share this post


Link to post
Share on other sites

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!

Edited by Guest

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

Edited by Guest

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this