我想知道是否有人能弄清楚我如何将这个折线图更改为饼图,并且仍然让按钮像线条颜色一样改变饼图的颜色?
http://jsfiddle.net/jugal/637ns/
$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
// the button handler
$('#button').click(function() {
chart.series[0].color = "#FF0000";
chart.series[0].graph.attr({ stroke: '#FF0000' });
$.each(chart.series[0].data, function(i, point) {
point.graphic.attr({ fill: '#FF0000' });
});
chart.redraw();
});
});
我想添加一个点击事件来改变饼图的颜色。
谢谢!