test2.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=GB18030"/>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="expires" content="0"/>
<script language="JavaScript" src="../FusionChartsBroad/FusionCharts.js"></script>
</head>
<body onload = "aa();">
<table>
<tr>
<td>
<div id="chartdiv" align="center"></div>
</td>
</tr>
</body>
</html>
<script type="text/javascript" >
function aa(){
var myChart = new FusionCharts("../FusionChartsBroad/AngularGauge.swf", "myChartId", "350", "200", "0", "0");
myChart.setDataXML(getxml());
myChart.render("chartdiv");
}
function getxml(){
var str1 = null;
str1 = "<chart dataStreamURL = 'test_data.jsp' refreshInterval = '5' animation = '0' palette = '2' bgAlpha = '0' bgColor = 'FFFFFF' lowerLimit = '0'" +
"upperLimit = '100' numberSuffix = '' showBorder = '0'" +
"basefontColor = 'FFFFDD' chartTopMargin = '25' chartBottomMargin = '25'" +
"chartLeftMargin = '25' chartRightMargin = '25' toolTipBgColor = '009999'" +
"gaugeFillMix = '{dark-10},{light-70},{dark-10}' gaugeFillRatio = '20'" +
"pivotRadius = '5' gaugeInnerRadius = '50%' tickValueDistance = '20' showvalue = '1' baseFontSize = '20' >" +
"<colorRange>" +
"<color minValue = '0' maxValue = '30' code = '8BBA00' />" +
"<color minValue = '30' maxValue = '60' code = 'F6BD0F' />" +
"<color minValue = '60' maxValue = '100' code = 'FF654F'/>" +
"</colorRange>" +
"<dials>" +
"<dial id = 'CPU1' value='92' rearExtension = '10' baseWidth = '2' toolText='CPU 1 Usage'/>" +
"</dials>" +
"<annotations>" +
"<annotationGroup id = 'Grp1' showBelow = '1'>" +
"<annotation type = 'rectangle' x = '5' y = '5' toX = '345' toY = '195'" +
"radius = '10' color = '009999,333333' showBorder = '0'/>" +
"</annotationGroup>" +
"</annotations>" +
"<styles>" +
"<definition>" +
"<style name = 'RectShadow' type = 'shadow' strength = '3'/>" +
"<style name = 'trendvaluefont' type = 'font' bold = '1'" +
"borderColor = 'FFFFDD'/>" +
"</definition>" +
"<application>" +
"<apply toObject = 'Grp1' styles='RectShadow'/>" +
"<apply toObject = 'Trendvalues' styles = 'trendvaluefont'/>" +
"</application>" +
"</styles>" +
"</chart>";
return str1;
}
</script>
test_data.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String call_str = null;
Random random = new Random();
call_str = "&cpu1=" + String.valueOf(random.nextInt(100));
//call_str = "100" +
//"|" + random.nextInt(100) +
//"|" + random.nextInt(100) +
//"|" + random.nextInt(100) +
//"|" + random.nextInt(100) +
//"|" + random.nextInt(100) ;
response.getWriter().write(call_str);
call_str = null;
%>
I set the property dataStreamURL = 'test_data.jsp' refreshInterval = '5',
But the page does not update, where the problem?
property upperLimit data is dynamically generated,
And how to set upperLimit = '' in test_data.jsp.