c#图表更改x轴上的最大值和最小值 [英] c# chart change max and min values on the x axis

查看:33
本文介绍了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天全站免登陆