amcharts 轴中可以有组吗?
检查 highcharts 中的示例:example
最佳答案
有点......这不是官方功能,但你可以伪造它。
您可以为标签创建一个图表,其中 valueField 始终为零。 您还需要偏移类别轴,以便标签不会相互隐藏。
这是一个示例:http://jsfiddle.net/amcharts/XY2cD/
// each data provider has a label property
dataProvider :
[{ ... ,
"label": 0
}, ... ],
// the first graph in each 'cluster' is for the label
"graphs": [
{
"type": "column",
"fillAlphas": 0, // hide this column
"lineAlpha": 0, // hide this column
"title": "my sub group name",
"valueField": "label", // this is the field that's always zero
"showAllValueLabels": true, // even though the field is zero - the label will be shown
"labelText": "\n[[title]]" // start this with a newline so it's below the axis
}, ... ],
"categoryAxis": {
"labelOffset": 15
}
(不是我的 fiddle ,我只是在网上找到的)
关于amcharts - Amcharts 中轴的组类别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22590155/