Highchart: Background color of Axis

后端 未结 2 345
野的像风
野的像风 2020-12-21 10:11

I saw a similar question here.

In reply its written that we can have background color by making a rectangle.

My question is how I can get x and

2条回答
  •  执念已碎
    2020-12-21 11:07

    Did you try to use labels.formatter with background and useHTML flag? Something like this: http://jsfiddle.net/AeV7h/

        xAxis: {
            categories: ['Foo', 'Bar', 'Foobar'],
    
            labels: {
                useHTML: true,
                formatter: function() {
                    return '' + this.value + '';
                }
            }
        },
    

    And CSS:

    .hc-label {
      background-color: red;
      padding: 0px 5px;
      color: yellow;
    }
    

提交回复
热议问题