CITASys Automation Posted November 3, 2022 Share Posted November 3, 2022 Hello, How to customize x axis and y axis label ( font size, font color, font style ) on uni chart uni bar series? Thankyou Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 3, 2022 Share Posted November 3, 2022 11 minutes ago, CITASys Automation said: How to customize x axis and y axis label ( font size, font color, font style ) on uni chart uni bar series? Hello, This post may help you: Quote Link to comment Share on other sites More sharing options...
CITASys Automation Posted November 3, 2022 Author Share Posted November 3, 2022 it work sherzod thankyou, its change the font size, then how to change font color? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 3, 2022 Share Posted November 3, 2022 4 minutes ago, CITASys Automation said: then how to change font color? Try this: function chart.beforeInit(sender, config) { config.axes[1].label = { fontSize: 14, color: "red" } } Quote Link to comment Share on other sites More sharing options...
CITASys Automation Posted November 3, 2022 Author Share Posted November 3, 2022 okay its work, then how to change x and y axis line color ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 3, 2022 Share Posted November 3, 2022 51 minutes ago, CITASys Automation said: then how to change x and y axis line color ? config.axes[0]... - y config.axes[1]... - x Quote Link to comment Share on other sites More sharing options...
CITASys Automation Posted November 3, 2022 Author Share Posted November 3, 2022 I mean this line, how to change line color, Quote Link to comment Share on other sites More sharing options...
PS1 Posted January 12 Share Posted January 12 is this possible ? I need a solution too. For bar series. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 12 Share Posted January 12 I will try to check once again. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 12 Share Posted January 12 On 11/3/2022 at 2:12 PM, CITASys Automation said: 3 hours ago, PS1 said: is this possible ? I need a solution too. For bar series. I'm trying. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 12 Share Posted January 12 Solution: function chart.beforeInit(sender, config) { //axisY config.axes[0].renderer = function(s, v, a) { a.attr.canvasAttributes.strokeStyle = 'green'; a.attr.canvasAttributes.lineWidth = 1.5; return v // or using number formatting //return Ext.util.Format.number(v, "#.00") }; //axisX config.axes[1].renderer = function(s, v, a) { a.attr.canvasAttributes.strokeStyle = 'blue'; a.attr.canvasAttributes.lineWidth = 1.5; return v // or using number formatting //return Ext.util.Format.number(v, "#.00") }; } Turns out, I already gave a similar solution: Quote Link to comment Share on other sites More sharing options...
PS1 Posted January 16 Share Posted January 16 Thank for your response and sorry for my late response(have been out of workplace for the long weekend). Your solution works, but it destroys other property of UniChart which is Axes->CustomLabels (Example on screenshots below). How can i set custom labels on the Y-axis and at the same time having your solution for coloring axis? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 16 Share Posted January 16 I will try to check. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17 Share Posted January 17 16 hours ago, PS1 said: Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 17 Share Posted January 17 function chart.beforeInit(sender, config) { //axisY config.axes[0].renderer = function(s, v, a, f) { a.attr.canvasAttributes.strokeStyle = 'green'; a.attr.canvasAttributes.lineWidth = 1.5; if (Ext.isArray(s.cLables)) { var _a = s.uLastIx; if (f === null) { _a = 0 } s.uLastIx = _a + 1; if (_a < s.cLables.length) { return s.cLables[_a] } } if (s.hideLabel == true) { return "" } return v // or using number formatting //return Ext.util.Format.number(v, "#.00") }; //axisX config.axes[1].renderer = function(s, v, a, f) { a.attr.canvasAttributes.strokeStyle = 'blue'; a.attr.canvasAttributes.lineWidth = 1.5; if (Ext.isArray(s.cLables)) { var _a = s.uLastIx; if (f === null) { _a = 0 } s.uLastIx = _a + 1; if (_a < s.cLables.length) { return s.cLables[_a] } } if (s.hideLabel == true) { return "" } return v // or using number formatting //return Ext.util.Format.number(v, "#.00") }; } 1 Quote Link to comment Share on other sites More sharing options...
PS1 Posted January 17 Share Posted January 17 Thanks, it works good ! ❤️ 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.