Highchart heatmap grouped category plugin styling issues

痴心易碎 提交于 2021-02-11 18:12:06

问题


Could someone please help me with following styling issues?

  1. Why are the categories not having line segmentation like shown in the column chart on plugin website? See the red marked area
  2. I would like to have minorGridlines property from HighChart to clearly de-markate the categories. In the example i have 2 sub categories for each category. How can i add minorgridlines at 2 category interval from highchart? Something like green lines in the picture is what i would like in the graph.

Here is my fiddle for the same 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']
        }
    ]
},

Thanks in advance for your help.


回答1:


  1. Increase tickWidth property (0 - by default)
  2. Use plotLines option:

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

Live demo: https://jsfiddle.net/BlackLabel/ekcq2td8/

API Reference: https://api.highcharts.com/highcharts/yAxis.tickWidth



来源:https://stackoverflow.com/questions/58978445/highchart-heatmap-grouped-category-plugin-styling-issues

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!