HighCharts - 动态更改轴标题颜色 [英] HighCharts - Dynamically Change Axis Title Color

查看:685
本文介绍了HighCharts - 动态更改轴标题颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在创建轴标题后更改它的字体颜色。我尝试了以下命令的所有变体,但无法获取任何内容。

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" } });

同样,我可以在创建剧情时做到这一点,我只需要找到选项命令或style命令来动态更新它。

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

推荐答案

使用update()函数。

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()

这篇关于HighCharts - 动态更改轴标题颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆