I have data plotted onto a MSChsart line graph.
On the Y axis I have values ranging form 0 300. could anyone let me know is it possible to
change my:
Y-axis LABEL values from (0 to 300) to a value of (-150 to 150).
without changing my Y-axis DATA values.
By this I mean I want the labels to show different values, but I dont want to edit my data values plotted. So for example if I have data plotted on Y-axis value of 150, the Y=axis label should be showing it at 0.
Any help would be greatly appreciated
Click the chart, and then click the Chart Layout tab. Under Labels, click Axis Titles, point to the axis that you want to add titles to, and then click the option that you want. Select the text in the Axis Title box, and then type an axis title.
The x-coordinate always comes first, followed by the y-coordinate. As you can see in the coordinate grid below, the ordered pairs (3,4) and (4,3) are two different points!
Right-click the category labels to change, and click Select Data. In Horizontal (Category) Axis Labels, click Edit. In Axis label range, enter the labels you want to use, separated by commas.
Implemt Customize event
private void chart1_Customize(object sender, EventArgs e)
{
foreach (var label in chart1.ChartAreas[0].AxisY.CustomLabels)
{
label.Text = (double.Parse(label.Text) - 150).ToString();
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With