Highcharts.js - Background color of axis only

99封情书 提交于 2019-12-01 04:32:01

问题


Thanks in advance for your time and help.

I'm using highcharts and need to set the background color of only the x and y axis. See attached:

So what I need is to set a background color on the x-axis that is different from the dark gray of the graph (right now they are obviously the same)

Does anyone know if this is possible and, if so, how to go about it? I've been through the highcharts API Highstock API extensively, but couldn't find anything specifically for this.

Thank you again for your time and help!

Rich


回答1:


Did you try:

 rendered a rectangle and positioned it to the bottom of the graph.
chart.renderer.rect(0/*position on X-axis*/, 275/*position on Y-axis*/, 680/*width*/ , 25/*height*/, 00)
         .attr({
            'stroke-width': 0,
            stroke: '#888888',
            fill: '#888888',
            zIndex: 3
         })
         .add();

Read more: highchart renderer

x-asis does not have backgroundColor Set background color to HighChart xAxis labels

Hope this help.



来源:https://stackoverflow.com/questions/15744343/highcharts-js-background-color-of-axis-only

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