winform中使用chart绘制柱状图,没法显示图表 方法如下:
publicvoidFillColumnChart(Chartchart2,string[]x,int[]y1,int[]y2){chart2.Legends.Clear...
public void FillColumnChart(Chart chart2,string[] x,int[] y1,int[] y2)
{
chart2.Legends.Clear();
chart2.ChartAreas[0].Area3DStyle.Enable3D = true;
chart2.ChartAreas[0].Area3DStyle.Inclination = 30;
chart2.ChartAreas[0].Area3DStyle.PointDepth = 50;
chart2.ChartAreas[0].Area3DStyle.IsClustered = true;
chart2.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
chart2.Series[0].ChartType = SeriesChartType.Column;
chart2.Series[0].Points.DataBindXY(x, y1);
Series second = new Series();
second.ChartType = SeriesChartType.Column;
second.Points.DataBindXY(x, y2);
chart2.Series.Add(second);
} 展开
{
chart2.Legends.Clear();
chart2.ChartAreas[0].Area3DStyle.Enable3D = true;
chart2.ChartAreas[0].Area3DStyle.Inclination = 30;
chart2.ChartAreas[0].Area3DStyle.PointDepth = 50;
chart2.ChartAreas[0].Area3DStyle.IsClustered = true;
chart2.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
chart2.Series[0].ChartType = SeriesChartType.Column;
chart2.Series[0].Points.DataBindXY(x, y1);
Series second = new Series();
second.ChartType = SeriesChartType.Column;
second.Points.DataBindXY(x, y2);
chart2.Series.Add(second);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询