amcharts - Amcharts 中轴的组类别

标签 amcharts

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/

相关文章:

javascript - 隐藏 AmCharts 外部数据 URL

javascript - amCharts valueAxis 最大值不起作用

javascript - rails : Restricting pure javascript in the asset pipeline to specific views

javascript - Amcharts Angular Directive(指令)

amcharts - AmChart map 中如何手动触发事件?

javascript - ClickMarker 无法在 XY Amcharts 中工作

mysql - 在 AmCharts 中显示数据库中的数据

javascript - 如何在 amcharts 中生成具有 4 个条件的表格

javascript - 是否可以使用 Amchart v4 在类别名称上显示工具提示?

amcharts - 从 TreeMap 中检索对象