fusioncharts同一页面显示2个仪表盘,且以java字符串作为xml数据

fusioncharts同一页面显示2个仪表盘,且以java字符串作为xml数据

<%@ page contentType="text/html; charset=UTF-8" %>
<%
	String path = request.getContextPath();
%>
<%
	String xml = "<chart manageResize=\"1\" origW=\"350\" origH=\"200\"  palette=\"2\" bgAlpha=\"0\" bgColor=\"FFFFFF\" lowerLimit=\"0\" upperLimit=\"100\" numberSuffix=\"%\" showBorder=\"0\" basefontColor=\"000000\" chartTopMargin=\"5\" chartBottomMargin=\"5\"  caption=\"设备运行状态实时监控\" subCaption=\"xxxxd\" toolTipBgColor=\"009999\" gaugeFillMix=\"{dark-10},{light-70},{dark-10}\" gaugeFillRatio=\"3\" pivotRadius=\"8\" gaugeOuterRadius=\"120\" gaugeInnerRadius=\"70%\"  gaugeOriginX=\"175\" gaugeOriginY=\"170\" trendValueDistance=\"5\" tickValueDistance=\"3\" manageValueOverlapping=\"1\" autoAlignTickValues=\"1\">   <colorRange>      <color minValue=\"0\" maxValue=\"45\" code=\"FF654F\"/>      <color minValue=\"45\" maxValue=\"80\" code=\"F6BD0F\"/>      <color minValue=\"80\" maxValue=\"100\" code=\"8BBA00\"/>   </colorRange>   <dials>      <dial value=\"72\" rearExtension=\"10\" baseWidth=\"10\"/>   </dials>   <trendpoints>      <point startValue=\"62\" displayValue=\"平均值\" useMarker=\"1\" markerRadius=\"8\" dashed=\"1\" dashLen=\"2\" dashGap=\"2\"  />   </trendpoints>   <annotations>      <annotationGroup id=\"Grp1\" showBelow=\"1\" showShadow=\"1\">         <annotation type=\"rectangle\" x=\"$chartStartX+5\" y=\"$chartStartY+5\" toX=\"$chartEndX-5\" toY=\"$chartEndY-5\" radius=\"10\" fillColor=\"009999,333333\" showBorder=\"0\" />      </annotationGroup>   </annotations>   <styles>      <definition>         <style name=\"RectShadow\" type=\"shadow\" strength=\"3\"/>		 <style name=\"trendvaluefont\" type=\"font\" bold=\"1\" borderColor=\"#00cccc\"/>      </definition>      <application>         <apply toObject=\"Grp1\" styles=\"RectShadow\" />		 <apply toObject=\"Trendvalues\" styles=\"trendvaluefont\" />      </application>   </styles></chart>";
%>
<HTML>
<HEAD>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<TITLE>FusionCharts - Multiple Charts on one Page</TITLE>
<SCRIPT LANGUAGE="Javascript" SRC="<%=path%>/frameworks/FusionCharts/FusionCharts.js"></SCRIPT>
<script type="text/javascript">
var contextpath = "<%=path%>";
var xml = '<%=xml%>';
</script>
<style type="text/css">
	body {
		font-family: Arial, Helvetica, sans-serif;
		font-size: 12px;
	}
</style>
</HEAD>
<BODY>
<div id="chartdiv1" align="center" class="text">
<script type="text/javascript">
	var myChart1 = new FusionCharts(contextpath+"/frameworks/FusionCharts/AngularGauge.swf", "myChartId1", "330", "300", "0", "0");
	myChart1.setDataXML(xml);
	myChart1.render("chartdiv1"); 
</script>
<div id="chartdiv2" align="center" class="text">
<script type="text/javascript">
	var myChart2 = new FusionCharts(contextpath+"/frameworks/FusionCharts/AngularGauge.swf", "myChartId2", "330", "300", "0", "0");
	myChart2.setDataXML(xml);
	myChart2.render("chartdiv2"); 
</script>
</BODY>
</HTML>

你可能感兴趣的:(FusionCharts,仪表盘,图形报表)