Highchart热图分组类别插件样式问题

时间:2019-11-21 15:31:45

标签: highcharts

enter image description here

有人可以帮我解决以下样式问题吗?

  1. 为什么类别没有像插件网站上的柱形图所示的线段?看到红色标记的区域
  2. 我希望拥有HighChart的minorGridlines属性,以清楚地标记类别。在示例中,每个类别有2个子类别。如何从highchart的2个类别间隔添加次要网格线?我想要的是图片中的绿线之类的东西。

这是我同一个https://jsfiddle.net/k16sdhrz/的小提琴

 chart: {
    type: 'heatmap',
},

yAxis: {
    categories: [{
            name: 'Cat 1',
            categories: ['Item 1_1', 'Item 1_2']
        },
        {
            name: 'Cat 2',
            categories: ['Item 2_1', 'item 2_2']
        }
    ]
},

在此先感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

  1. 增加tickWidth属性(默认为0-
  2. 使用plotLines选项:

yAxis: {
    tickWidth: 1,
    labels: {
        x: -5
    },
    plotLines: [{
        value: -0.5,
        color: 'green',
        width: 5,
        zIndex: 10
    }, ...]
}

实时演示: https://jsfiddle.net/BlackLabel/ekcq2td8/

API参考: https://api.highcharts.com/highcharts/yAxis.tickWidth

相关问题