HighCharts - Dynamically Change Axis Title Color

2019-05-24 13:39发布

I need to change the font color of the axis title after it has been created. I have tried all variations on the commands below but can't get anything to work.

Chart.yAxis[0].setOptions({ yAxis: { title: { styles: {  color: '#FFFFFF' } } } });
Chart.yAxis[0].axisTitle.attr({ styles:{ color:"#FFFFFF" } });

Again, I can do this upon creation of the plot, I just need to find the option command or style command to update this dynamically.

Thanks

标签: highcharts
1条回答
forever°为你锁心
2楼-- · 2019-05-24 14:09

You can use update() function.

http://jsfiddle.net/sbochan/xm2QA/

chart.yAxis[0].update({
                title:{
                    style:{
                        color:'red'
                    }
                }
            });

http://api.highcharts.com/highcharts#Axis.update()

查看更多
登录 后发表回答