I have a datasource like this(the PCName is variational)
Year PCName Price
2009 Dell 100
2009 Lenovo 95.4
2009 ASUS 85
2008 Dell 130
2008 Lenovo 75.4
2008 ASUS 81.5
2010 Dell 95.0
2010 Lenovo 95.4
2010 ASUS 97
i set the SeriesMappings or chart control code behind above,and it works fine!
But now i want to set different
can i do it code behind use the same datasource
Year PCName Price
2009 Dell 100
2009 Lenovo 95.4
2009 ASUS 85
2008 Dell 130
2008 Lenovo 75.4
2008 ASUS 81.5
2010 Dell 95.0
2010 Lenovo 95.4
2010 ASUS 97
ChartControl.SeriesMappings.Clear();
SeriesMapping BarMapping =
new
SeriesMapping();
BarSeriesDefinition BarDefinition =
new
BarSeriesDefinition();
BarDefinition.ShowItemLabels =
true
;
BarDefinition.ShowItemToolTips =
true
;
BarDefinition.LabelSettings.ShowZeroValueLabels =
false
;
BarLabelSettings BarLabelSettings =
new
BarLabelSettings(LabelDisplayMode.MidPoint);
BarLabelSettings.ShowZeroValueLabels =
false
;
BarDefinition.LabelSettings = BarLabelSettings;
BarMapping.SeriesDefinition = BarDefinition;
BarMapping.ItemMappings.Add(
new
ItemMapping(
"Price"
, DataPointMember.YValue));
BarMapping.ItemMappings.Add(
new
ItemMapping(
"Year"
, DataPointMember.XCategory));
BarMapping.GroupingSettings.GroupDescriptors.Add(
new
ChartGroupDescriptor(
"PCName"
));
ChartControl.SeriesMappings.Add(BarMapping);
i set the SeriesMappings or chart control code behind above,and it works fine!
But now i want to set different
SeriesMapping
, first year data use BarSeriesDefinition
,and second year data use LineSeriesDefinition
,third year another ,forth another can i do it code behind use the same datasource