VS2010 C#用chart导入数据后曲线变化不明显
this.chart1.Series[0].ChartType=SeriesChartType.Line;for(inti=0;i<300;i++){inttazhong...
this.chart1.Series[0].ChartType = SeriesChartType.Line; for (int i = 0; i < 300; i++) { int tazhong = bestweight[i]; this.chart1.Series[0].Points.AddXY(i, tazhong); }用的这个代码,然后bestweight里的数值都比较大,14xxxx这样,结果显示的图片如图,但是我想让他显示出来有波动,就是纵坐标区分程度大些,求怎么解决,谢谢!
展开
展开全部
这个是要设置y轴的值,如果你的数据都是140000以上 那么你可以把y轴的最小值设置成140000.
private void SetAxisY()
{
Axis AxisY = new Axis()
{
LineColor = Color.FromArgb(64, 64, 64, 64),
// Y轴标签字体大小
LabelAutoFitMinFontSize = 10,
// Y轴标签显示样式
LabelStyle = new LabelStyle() { Format = "{#}.0%" },
// 网格Y轴设置
MajorGrid = new Grid() { LineColor = Color.FromArgb(64, 64, 64, 64) },
// Y轴的最大值
Maximum = 1000,
// Y轴的最小值
Minimum = 0,
// Y轴标签间距
Interval = 500,
// 最小刻度
MajorTickMark = new TickMark() { TickMarkStyle = TickMarkStyle.OutsideArea, Size = 500 },
};
System.Windows.Forms.DataVisualization.Charting.Chart c = new System.Windows.Forms.DataVisualization.Charting.Chart();
c.ChartAreas[0].AxisY = AxisY;
}
private void SetAxisY()
{
Axis AxisY = new Axis()
{
LineColor = Color.FromArgb(64, 64, 64, 64),
// Y轴标签字体大小
LabelAutoFitMinFontSize = 10,
// Y轴标签显示样式
LabelStyle = new LabelStyle() { Format = "{#}.0%" },
// 网格Y轴设置
MajorGrid = new Grid() { LineColor = Color.FromArgb(64, 64, 64, 64) },
// Y轴的最大值
Maximum = 1000,
// Y轴的最小值
Minimum = 0,
// Y轴标签间距
Interval = 500,
// 最小刻度
MajorTickMark = new TickMark() { TickMarkStyle = TickMarkStyle.OutsideArea, Size = 500 },
};
System.Windows.Forms.DataVisualization.Charting.Chart c = new System.Windows.Forms.DataVisualization.Charting.Chart();
c.ChartAreas[0].AxisY = AxisY;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询