C#中的图表变化最大值和最小值在x轴上 [英] c# chart change max and min values on the x axis

查看:1002
本文介绍了C#中的图表变化最大值和最小值在x轴上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能告诉我如何改变在C#图表上的x轴的最小值和最大值?我想去从0到13,但现在进入从-1到14。

Can someone tell me how to change the min and max values on the x axis on a C# chart? I want to go from 0 to 13, but it goes from -1 to 14 right now.

推荐答案

如果您使用的是 System.Windows.Forms.DataVizualisation.Charting 你可以通过操纵图表的 ChartAreas 属性设置轴范围。因此,像

If you are using System.Windows.Forms.DataVizualisation.Charting you can set the Axis range by manipulating the chart's ChartAreas property. So something like

myChart.ChartAreas[0].AxisX.Maximum = 13;
myChart.ChartAreas[0].AxisX.Minimum = 0;

这篇关于C#中的图表变化最大值和最小值在x轴上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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