使用Spring MVC与fusioncharts结合
现在是在jsp页面上,写了一个按钮,叫做“显示图表”,在这个页面上展示了一些数据,现在想把这些数据在点击“显示图表”按钮后已图表的形式显示出来,不知道该怎么把funcha...
现在是在jsp页面上,写了一个按钮,叫做“显示图表”,在这个页面上展示了一些数据,现在想把这些数据在点击“显示图表”按钮后已图表的形式显示出来,不知道该怎么把funcharts引入。
这样比如页面上有数据位1,2,7 以饼状图显示。 展开
这样比如页面上有数据位1,2,7 以饼状图显示。 展开
展开全部
给个列子。等下把数字自己填充进去。
引入:
<script type="text/javascript" src="js/fusioncharts/js/fusioncharts.js"></script>
<script type="text/javascript" src="js/fusioncharts/js/themes/fusioncharts.theme.zune.js"></script>
script:
FusionCharts.ready(function(){
var revenueChart = new FusionCharts({
type: "pie3d",
renderAt: "chartContainer",
width: "500",
height: "300",
dataFormat: "json",
dataSource: {
"chart": {
"caption": "Monthly revenue for last year",
"subCaption": "Harry's SuperMart",
"xAxisName": "Month",
"yAxisName": "Revenues (In USD)",
"theme": "zune"
},
"data": [
{
"label": "Jan",
"value": "420000"
},
{
"label": "Feb",
"value": "810000"
},
{
"label": "Mar",
"value": "720000"
},
{
"label": "Apr",
"value": "550000"
},
{
"label": "May",
"value": "910000"
},
{
"label": "Jun",
"value": "510000"
},
{
"label": "Jul",
"value": "680000"
},
{
"label": "Aug",
"value": "620000"
},
{
"label": "Sep",
"value": "610000"
},
{
"label": "Oct",
"value": "490000"
},
{
"label": "Nov",
"value": "900000"
},
{
"label": "Dec",
"value": "730000"
}
]
}
});
revenueChart.render("chartContainer");
});
jsp:
<div id="chartContainer">FusionCharts XT will load here!</div>
引入:
<script type="text/javascript" src="js/fusioncharts/js/fusioncharts.js"></script>
<script type="text/javascript" src="js/fusioncharts/js/themes/fusioncharts.theme.zune.js"></script>
script:
FusionCharts.ready(function(){
var revenueChart = new FusionCharts({
type: "pie3d",
renderAt: "chartContainer",
width: "500",
height: "300",
dataFormat: "json",
dataSource: {
"chart": {
"caption": "Monthly revenue for last year",
"subCaption": "Harry's SuperMart",
"xAxisName": "Month",
"yAxisName": "Revenues (In USD)",
"theme": "zune"
},
"data": [
{
"label": "Jan",
"value": "420000"
},
{
"label": "Feb",
"value": "810000"
},
{
"label": "Mar",
"value": "720000"
},
{
"label": "Apr",
"value": "550000"
},
{
"label": "May",
"value": "910000"
},
{
"label": "Jun",
"value": "510000"
},
{
"label": "Jul",
"value": "680000"
},
{
"label": "Aug",
"value": "620000"
},
{
"label": "Sep",
"value": "610000"
},
{
"label": "Oct",
"value": "490000"
},
{
"label": "Nov",
"value": "900000"
},
{
"label": "Dec",
"value": "730000"
}
]
}
});
revenueChart.render("chartContainer");
});
jsp:
<div id="chartContainer">FusionCharts XT will load here!</div>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询