-
3 Apr 2012 1:37 AM #1
Answered: Change label color at runtime
Answered: Change label color at runtime
Hi everyone.
I need to change the color of my line chart bottom axis at runtime.
My chart has a right and a bottom axis. I am able to change the color of the right axis labels by setting:
This works fine and the color changes after calling the redraw method.Code:this.lineChart.axes.items[0].labelStyle.style.fill = newColor; this.lineChart.redraw();
Unfortunately I am not able to change the color of the bottom axis. If I try to change it like I did with the right axis, nothing happens.
I got a little stuck so I'd be very pleased about any hint..Code:this.lineChart.axes.items[1].labelStyle.style.fill = newColor;
-
Best Answer Posted by mitchellsimoens
Have you tried the label config on the axis?
-
3 Apr 2012 7:35 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
- Answers
- 3102
Have you tried the label config on the axis?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
4 Apr 2012 5:43 AM #3
Do you mean
?Code:this.lineChart.axes.items[1].label.fill = 'somecolor'; this.lineChart.redraw();
I tried that, but it doesn't work either.
The set color via config before rendering is being set correctly.
Code:label: { fill: 'red' }
-
13 Apr 2012 7:02 AM #4
Hi,
I now managed to change change the label colors by setting a different config and creating a new instance of the chart.
Thanks,
Buzztee
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote