amcharts显示图表时怎么动态获取数据
1个回答
2015-01-02 · 知道合伙人数码行家
huanglenzhi
知道合伙人数码行家
向TA提问 私信TA
知道合伙人数码行家
采纳数:117538
获赞数:517196
长期从事计算机组装,维护,网络组建及管理。对计算机硬件、操作系统安装、典型网络设备具有详细认知。
向TA提问 私信TA
关注
展开全部
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>员工统计</title>
<link rel="stylesheet" href="style.css" type="text/css">
<script src="../amcharts/amcharts.js" type="text/javascript"></script>
<script type="text/javascript">
var chart;
var chartData = [{
company: "总公司",
visits: 654
}, {
company: "广州",
visits: 425
}, {
company: "上海",
visits: 209
}, {
company: "深圳",
visits: 122
}, {
company: "长沙",
visits: 22
}, {
company: "南京",
visits: 312
}, {
company: "西安",
visits: 233
}, {
company: "福州",
visits: 111
}];
AmCharts.ready(function () {
// PIE CHART
chart = new AmCharts.AmPieChart();
// title of the chart
chart.addTitle("员工统计", 16);
chart.dataProvider = chartData;
chart.titleField = "company";
chart.valueField = "visits";
chart.sequencedAnimation = true;
chart.startEffect = "elastic";
chart.innerRadius = "30%";
chart.startDuration = 2;
chart.labelRadius = 15;
// the following two lines makes the chart 3D
chart.depth3D = 10;
chart.angle = 15;
// WRITE
chart.write("chartdiv");
});
</script>
</head>
<body>
<div id="chartdiv" style="width:600px; height:400px;"></div>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>员工统计</title>
<link rel="stylesheet" href="style.css" type="text/css">
<script src="../amcharts/amcharts.js" type="text/javascript"></script>
<script type="text/javascript">
var chart;
var chartData = [{
company: "总公司",
visits: 654
}, {
company: "广州",
visits: 425
}, {
company: "上海",
visits: 209
}, {
company: "深圳",
visits: 122
}, {
company: "长沙",
visits: 22
}, {
company: "南京",
visits: 312
}, {
company: "西安",
visits: 233
}, {
company: "福州",
visits: 111
}];
AmCharts.ready(function () {
// PIE CHART
chart = new AmCharts.AmPieChart();
// title of the chart
chart.addTitle("员工统计", 16);
chart.dataProvider = chartData;
chart.titleField = "company";
chart.valueField = "visits";
chart.sequencedAnimation = true;
chart.startEffect = "elastic";
chart.innerRadius = "30%";
chart.startDuration = 2;
chart.labelRadius = 15;
// the following two lines makes the chart 3D
chart.depth3D = 10;
chart.angle = 15;
// WRITE
chart.write("chartdiv");
});
</script>
</head>
<body>
<div id="chartdiv" style="width:600px; height:400px;"></div>
</body>
</html>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询