为什么我在mschart上看不到最大轴x值? [英] Why I can't see the maximum axis x value on mschart?

查看:117
本文介绍了为什么我在mschart上看不到最大轴x值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。我在源头下设置了Axis X的最大值。





 float x = 0; 
float y = 0;


for(int i = 0; i< 400; i ++)
{
x =((float)i * 0.01f);
y = i;
chart1.Series [0] .Points.AddXY(x,y);
}

chart1.ChartAreas [0] .AxisX.IntervalOffset = 0.01;
chart1.ChartAreas [0] .AxisX.Maximum = 1;
chart1.ChartAreas [0] .AxisX.Maximum = 4;





和执行程序。

但是我看不到Axis X最大值(4)..我可以看到0,1,2,3。

为什么看起来像这样? ..是否需要设置更多?..



我尝试过:



我更改了轴x间隔。但是......它仍然是..

解决方案

你注意到你设置了最多2次吗?

 chart1.ChartAreas [ 0 ]。AxisX.Maximum =  1 ; 
chart1.ChartAreas [ 0 ]。AxisX.Maximum = 4 ;



我想你的意思是

 chart1.ChartAreas [ 0 ] .AxisX.Minimum =  1 ; 
chart1.ChartAreas [ 0 ]。AxisX.Maximum = 4 ;


hello. i set the Axis X maximum value like under the source.


float x = 0;
float y = 0;


for (int i = 0; i < 400; i++)
{
    x = ((float)i * 0.01f);
    y = i;
    chart1.Series[0].Points.AddXY(x, y);
}

chart1.ChartAreas[0].AxisX.IntervalOffset = 0.01;
chart1.ChartAreas[0].AxisX.Maximum = 1;
chart1.ChartAreas[0].AxisX.Maximum = 4;



and executed program.
but the i can't see the Axis X Maximum value (4).. i can see 0 , 1, 2, 3 .
why was look like this?.. is it need to setting more ?..

What I have tried:

I changed the axis x interval. but.. it was still..

解决方案

Did you noticed that you set Maximum 2 times?

chart1.ChartAreas[0].AxisX.Maximum = 1;
chart1.ChartAreas[0].AxisX.Maximum = 4;


I guess you meant

chart1.ChartAreas[0].AxisX.Minimum = 1;
chart1.ChartAreas[0].AxisX.Maximum = 4;


这篇关于为什么我在mschart上看不到最大轴x值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆