Profile Picture

How to change the scale of an axis

Posted By Joël Golinucci 10 Years Ago
Author
Message
Joël Golinucci
Posted 10 Years Ago
View Quick Profile
Junior Member

Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 30, Visits: 61
Hi,

I'm displaying points each 0.5m using NBarSeries (each bar represents 0.5m) and thus I have my X-axis going from 0 to 180 but in fact there really is only 90m. How can I get the labels displaying half the value only so that I have my X-axis going from 0 to 90 ?

Thanks for your help,

Regards,

Joël

Nevron Support
This post has been flagged as an answer
Posted 10 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Joel,

You have two options:

1. Use custom labels (All Examples\Axes\General\Axis Labels).
2. Use a custom value formatter:

public class CustomValueFormatter : NValueFormatter

{

public override string FormatValue(double value)

{

return (value / 2.0).ToString();

}

public override string FormatValue(object value)

{

return FormatValue((double)value);

}

}


NOrdinalScaleConfigurator ordinalScale = chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NOrdinalScaleConfigurator;

ordinalScale.LabelValueFormatter = new CustomValueFormatter();





Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic