chartControl控件 图形转换报错问题
chartControl控件通过
DevExpress.XtraCharts.LineSeriesView LineSeriesView = new DevExpress.XtraCharts.LineSeriesView();
foreach (Series Series in chartControl1.Series)
{
Series.View = LineSeriesView;
((LineSeriesView)Series.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True;
Series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
}
从柱状图转换成线状图
再转换柱状图
foreach (Series Series in chartControl1.Series)
{
Series.CrosshairEnabled = DevExpress.Utils.DefaultBoolean.False;
Series.View = ((BarSeriesView)Series.View);////问题在这里
Series.LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
Series.DataSource = dtView_Day_Hours;
}
会报错
无法将类型为“DevExpress.XtraCharts.LineSeriesView”的对象强制转换为类
型“DevExpress.XtraCharts.BarSeriesView”。
如何解决?求大神
页:
[1]