Hello Telerik Team,
i try to reproduce the sample here : http://demos.telerik.com/silverlight/#Chart/FirstLook
especially the first chart (top left):
here the code in my view :
and here the key functions in my view model (also trying the same thing than the sample) :
Here the data send to the chart :
Date(with format : dd/mm/yyyy) Durée Nom
12/12/2011 0,5 Acquérir
12/12/2011 0,5 Acquérir
12/12/2011 0,5 Assurer les corrections
11/12/2011 0,5 Assurer le service continu
13/12/2011 10,0 Assurer la sécurité
14/12/2011 4,0 Assurer la sécurité
16/12/2011 1,5 Assurer la sécurité
21/12/2011 2,0 Assurer la sécurité
but i obtain the result in first attached file...
it looks good but it's not because they are all from 2011 but dispatched between 3 bars. normally only one must display in this case.
i have the same behavior when clicking for the details of month : i get 3 bars, all marked "december".
when i remove DefaultLabelFormat="{Binding AxisXLabelFormatCobitProcess}" from charting:axisX, i have the second picture attached where clearly we see 3 differents labels so... is the chartyeargroupdescriptor works well ? where is my mistake ?
i'm in default culture : french culture, don't know if there is an incidence.
thanks by advance for your help,
Regards,
Maxence
i try to reproduce the sample here : http://demos.telerik.com/silverlight/#Chart/FirstLook
especially the first chart (top left):
here the code in my view :
<
chart:RadChart
Grid.Row
=
"2"
Grid.ColumnSpan
=
"2"
x:Name
=
"barChartCobitProcess"
ItemsSource
=
"{Binding CobitProcess}"
SeriesMappings
=
"{Binding BarChartProcessCobitSeriesMappings}"
telerik:StyleManager.Theme
=
"Metro"
>
<
chart:RadChart.DefaultView
>
<
charting:ChartDefaultView
>
<
charting:ChartDefaultView.ChartLegend
>
<
charting:ChartLegend
Name
=
"legend1"
/>
</
charting:ChartDefaultView.ChartLegend
>
<
charting:ChartDefaultView.ChartArea
>
<
charting:ChartArea
Grid.ColumnSpan
=
"2"
LegendName
=
"legend1"
ItemWidthPercent
=
"50"
Command
=
"{Binding ChartArea1ClickCommand}"
>
<
charting:ChartArea.AxisX
>
<
charting:AxisX
DefaultLabelFormat
=
"{Binding AxisXLabelFormatCobitProcess}"
/>
</
charting:ChartArea.AxisX
>
<
charting:ChartArea.AxisY
>
<
charting:AxisY
IsZeroBased
=
"True"
ExtendDirection
=
"None"
/>
</
charting:ChartArea.AxisY
>
</
charting:ChartArea
>
</
charting:ChartDefaultView.ChartArea
>
</
charting:ChartDefaultView
>
</
chart:RadChart.DefaultView
>
</
chart:RadChart
>
and here the key functions in my view model (also trying the same thing than the sample) :
private void InitializeBarChartCobitProcessSeriesMappings()
{
SeriesMappingCollection seriesMappings = new SeriesMappingCollection();
foreach (string categorie in this.ListCobitProcess)
{
StackedBarSeriesDefinition seriesDefinition1 = CreateBarSeriesDefinition();
SeriesMapping seriesMapping1 = this.CreateSeriesMapping(categorie, seriesDefinition1, "Heures", ChartAggregateFunction.Sum);
//seriesMapping1.GroupingSettings.GroupDescriptors.Add(new ChartYearGroupDescriptor("Date"));
seriesMappings.Add(seriesMapping1);
}
this.BarChartProcessCobitSeriesMappings = seriesMappings;
}
private static StackedBarSeriesDefinition CreateBarSeriesDefinition()
{
StackedBarSeriesDefinition seriesDefinition = new StackedBarSeriesDefinition();
seriesDefinition.ShowItemLabels = false;
seriesDefinition.LabelSettings.LabelDisplayMode = LabelDisplayMode.Inside;
return seriesDefinition;
}
private SeriesMapping CreateSeriesMapping(string nom, SeriesDefinition seriesDefinition, string yValueField, ChartAggregateFunction aggFunction)
{
SeriesMapping result = new SeriesMapping();
result.LegendLabel = nom;
result.SeriesDefinition = seriesDefinition;
result.ItemMappings.Add(new ItemMapping("Date", DataPointMember.XCategory));
result.ItemMappings.Add(new ItemMapping(yValueField, DataPointMember.YValue, aggFunction));
result.FilterDescriptors.Add(new FilterDescriptor("Nom", FilterOperator.IsEqualTo, nom));
result.GroupingSettings.ShouldFlattenSeries = true;
result.GroupingSettings.GroupDescriptors.Add(new ChartYearGroupDescriptor("Date"));
return result;
}
Here the data send to the chart :
Date(with format : dd/mm/yyyy) Durée Nom
12/12/2011 0,5 Acquérir
12/12/2011 0,5 Acquérir
12/12/2011 0,5 Assurer les corrections
11/12/2011 0,5 Assurer le service continu
13/12/2011 10,0 Assurer la sécurité
14/12/2011 4,0 Assurer la sécurité
16/12/2011 1,5 Assurer la sécurité
21/12/2011 2,0 Assurer la sécurité
but i obtain the result in first attached file...
it looks good but it's not because they are all from 2011 but dispatched between 3 bars. normally only one must display in this case.
i have the same behavior when clicking for the details of month : i get 3 bars, all marked "december".
when i remove DefaultLabelFormat="{Binding AxisXLabelFormatCobitProcess}" from charting:axisX, i have the second picture attached where clearly we see 3 differents labels so... is the chartyeargroupdescriptor works well ? where is my mistake ?
i'm in default culture : french culture, don't know if there is an incidence.
thanks by advance for your help,
Regards,
Maxence