Customize axis units text

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
jorge
Posts: 20
Joined: Tue Jun 28, 2016 7:54 am

Customize axis units text

Post by jorge » Tue Jun 28, 2016 10:59 am

I would like to know if this in particular is possible. I have a chart with an Y axis. In the axis units, if the value is greater than zero, I would like to draw the axis units using a specific color (eg: white), and if the axis units value is less than zero, I would like the units to have a different color (eg: red). Is this possible using only one Y axis?

Thanks

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Customize axis units text

Post by ArctionPasi » Tue Jun 28, 2016 11:21 am

Axis bar color can be changed with a palette:
Chart axis coloring
Chart axis coloring
PaletteColoringOfYAxis.jpg (445.87 KiB) Viewed 7111 times
But the ticks and labels are not colored.


CustomAxisTicks support individual coloring of ticks and grid lines.
Custom axis ticks and grids
Custom axis ticks and grids
CustomAxisTicks.jpg (306.78 KiB) Viewed 7111 times
Labels are not colored though.

If labels coloring is a requirement, please contact our sales and mention this as condition in Purchase Order of licenses. I'm sure our team can add some kind of event or callback method to color the labels by value.
LightningChart Support Team, PT

jorge
Posts: 20
Joined: Tue Jun 28, 2016 7:54 am

Re: Customize axis units text

Post by jorge » Tue Jun 28, 2016 12:47 pm

Thanks for the answer. I will let you know if this would be important for us.

Also, could you please let me know if I can somehow modify the label text? I would like for example to prepend the dollar symbol to every label in the Y axis, or add a comma to indicate the thousands. Would this be possible? I had a look at the examples but couldn't find anything similar.

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Customize axis units text

Post by ArctionPasi » Tue Jun 28, 2016 12:56 pm

Axis.AutoFormatLabels = False
Axis.LabelsNumberFormat = .... use normal formatting string here, same as you would use to Double.ToString() method. Almost. if you specify .ffffff it will show more decimals than .NET normally would.
LightningChart Support Team, PT

jorge
Posts: 20
Joined: Tue Jun 28, 2016 7:54 am

Re: Customize axis units text

Post by jorge » Tue Jun 28, 2016 1:18 pm

The currency formatting worked very well. Thanks.

Chart.ViewXY.YAxes[0].LabelsNumberFormat = "C";

Post Reply