Hi,
I'm facing problem while generating a stacked chart form the code behind, its showing only the last entered 'Y Value' in the chart. I think i'm facing problem to group all the values properly. Please help me out.
In the above code the chart is generating for only "Meter4", but not for other Y Values!
I'm facing problem while generating a stacked chart form the code behind, its showing only the last entered 'Y Value' in the chart. I think i'm facing problem to group all the values properly. Please help me out.
public
StackedBar()
{
InitializeComponent();
SeriesMapping series =
new
SeriesMapping();
series.SeriesDefinition =
new
StackedBarSeriesDefinition();
series.GroupingSettings.StackGroupFieldName =
"Branch1"
;
series.ItemMappings.Add(
new
ItemMapping(
"MonthName"
, DataPointMember.XCategory));
series.ItemMappings.Add(
new
ItemMapping(
"Meter1"
, DataPointMember.YValue));
series.ItemMappings.Add(
new
ItemMapping(
"Meter2"
, DataPointMember.YValue));
series.ItemMappings.Add(
new
ItemMapping(
"Meter3"
, DataPointMember.YValue));
series.ItemMappings.Add(
new
ItemMapping(
"Meter4"
, DataPointMember.YValue));
StackBarChart.ItemsSource = GetReVenue();
StackBarChart.DataBound +=
new
EventHandler<ChartDataBoundEventArgs>(StackBarChart_DataBound);
StackBarChart.SeriesMappings.Add(series);
}