c#改变坐标轴的标注。

I have a chart it looks like this 
http://imgur.com/XoeCnvO

I want to change Y axis numbering and label it 1% 10% 33.% etc as shown below without changing the plot.
How do I change it


Required output graph:

http://imgur.com/fJ6bQzk


1
Vulpes
Vulpes
  • 2
  • 96.8k
  • 1m
Apr 11 2014 8:49 AM
Try something like this:

CustomLabel label1 = new CustomLabel
{
   FromPosition = -3.5,
   ToPosition = -2.5,
   Text = "1%"
};

CustomLabel label2 = new CustomLabel
{
   FromPosition = -2.5,
   ToPosition = -1.5,
   Text = "10%"
};

CustomLabel label3 = new CustomLabel
{
   FromPosition = -1.5,
   ToPosition = -0.5,
   Text = "33.3%"
};

CustomLabel label4 = new CustomLabel
{
   FromPosition = -0.5,
   ToPosition = 0.5,
   Text = "50%"
};

CustomLabel label5 = new CustomLabel
{
   FromPosition = 0.5,
   ToPosition = 1.5,
   Text = "66.7%"
};

CustomLabel label6 = new CustomLabel
{
   FromPosition = 1.5,
   ToPosition = 2.5,
   Text = "90%"
};

CustomLabel label7 = new CustomLabel
{
   FromPosition = 2.5,
   ToPosition = 3.5,
   Text = "99%"
};

chart1.ChartAreas[0].AxisY.CustomLabels.Add(label1);
chart1.ChartAreas[0].AxisY.CustomLabels.Add(label2);
chart1.ChartAreas[0].AxisY.CustomLabels.Add(label3);
chart1.ChartAreas[0].AxisY.CustomLabels.Add(label4);
chart1.ChartAreas[0].AxisY.CustomLabels.Add(label5);
chart1.ChartAreas[0].AxisY.CustomLabels.Add(label6);
chart1.ChartAreas[0].AxisY.CustomLabels.Add(label7);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值