MSChart的Y轴和X轴标签 [英] MSChart Y-Axis and X-Axis Labelling
本文介绍了MSChart的Y轴和X轴标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经绘制的数据到一个MSChsart线图。
I have data plotted onto a MSChsart line graph.
在Y轴上我值范围从0 300任何人都可以让我知道是否有可能
On the Y axis I have values ranging form 0 300. could anyone let me know is it possible to
改变我的:
这是(0〜300)的值Y轴的标签值(-150至150)。
Y-axis LABEL values from (0 to 300) to a value of (-150 to 150).
在不改变我的Y轴的数据值。
without changing my Y-axis DATA values.
我的意思是我想要的标签,以显示不同值,但我不想要编辑绘制我的数据值。
因此,举例来说,如果我有150 Y轴值绘制数据时,Y =轴标签应显示它在0。
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.
任何帮助将不胜感激
推荐答案
Implemt自定义事件
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();
}
}
这篇关于MSChart的Y轴和X轴标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文