Del*_*lso 3 charts colors amcharts
我按照这个代码http://jsfiddle.net/amcharts/w8Bcy/来创建我自己的柱形图.我成功了,但现在我想用其他选项来改进这些图表.
实际图表def是:
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "none",
"dataProvider": chartData,
"valueAxes": [{
"gridColor": "#FFFFFF",
"gridAlpha": 0.2,
"dashLength": 0
}],
"gridAboveGraphs": true,
"startDuration": 1,
"graphs": [{
"balloonText": "[[category]]: <b>[[value]]</b>",
"fillAlphas": 0.8,
"lineAlpha": 0.2,
"type": "column",
"valueField": "visits"
}],
"chartCursor": {
"categoryBalloonEnabled": false,
"cursorAlpha": 0,
"zoomable": false
},
"categoryField": "country",
"categoryAxis": {
"gridPosition": "start",
"gridAlpha": 0
},
"exportConfig": {
"menuTop": 0,
"menuItems": [{
"icon": '/lib/3/images/export.png',
"format": 'png'
}]
}
});
Run Code Online (Sandbox Code Playgroud)
我有多个列有一些值,我希望列具有基于其值的颜色.我怎样才能改变列颜色?
示例:在x下,列将为红色.在x上方,列将为绿色.
我还想跟踪一条带有参考值的线.
谢谢.
graph.colorField = "color"
Run Code Online (Sandbox Code Playgroud)
并在数据添加字段中
"color" : "your color hex code "
Run Code Online (Sandbox Code Playgroud)
在http://jsfiddle.net/w8Bcy/68/完成检查我的颜色都是红色的,你可以在生成数据时添加你选择的颜色/ json
| 归档时间: |
|
| 查看次数: |
19840 次 |
| 最近记录: |