1、数据源提供
Bulb.xml:
<?xml version="1.0" encoding="UTF-8"?>
<chart lowerLimit="0" upperLimit="100" caption="收入" numberPrefix="$" numberSuffix="K" showValue="1">
<colorRange>
<color minValue="0" maxValue="10" code="AA8989"/>
<color minValue="10" maxValue="20" code="549485"/>
<color minValue="20" maxValue="30" code="666666"/>
<color minValue="30" maxValue="40" code="786767"/>
<color minValue="40" maxValue="50" code="BB7878"/>
<color minValue="50" maxValue="60" code="FF0000"/>
<color minValue="60" maxValue="70" code="00FF00"/>
<color minValue="70" maxValue="100" code="0000FF"/>
</colorRange>
<value>80</value>
<target>82</target>
</chart>
2、JSP页面
Bulb.jsp:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FusionWidgets Bulb图</title>
<script type="text/javascript" src="../Chart/JS/jquery-2.1.0.js"></script>
<script type="text/javascript" src="../Chart/JS/FusionCharts.js"></script>
<script type="text/javascript">
$(function(){
var bulb = new FusionCharts( "../Chart/SWF/Bulb.swf", "bulbId", "100%", "550", "0" );
bulb.setXMLUrl("xml/Bulb.xml");
bulb.render("bulbDiv");
});
</script>
</head>
<body>
<div id="bulbDiv"></div>
</body>
</html>
3、运行结果