Hi
I create my XamDataChart with one NumericXAxis and CategoryYAxis.
I create StackedBarSeries with GroupBy item source with AutoGenerateSeries = true.
Everithing shows ok, but on Numeric axis not showing labels and in Legen is only show "SeriesTitle" for all Fragment.
Labels in Legend i repair on event SeriesCreated, but Labels on Numeric axis not:(
I use NetAdvantageWPFDataVisualisation2011.2.
Is it some bug with Autogeneration?
Infragistics.GroupBy gb = new Infragistics.GroupBy(); gb.ItemsSource = DataGrafu; gb.GroupMemberPath = "Datum"; gb.KeyMemberPath = "FragmentNazev"; gb.ValueMemberPath = "Hodnota";
...
NumericXAxis xAxis = new NumericXAxis(); xAxis.Label = "{:N2} EUR"; this.DataChart.Axes.Add(xAxis);
CategoryYAxis yAxis = new CategoryYAxis(); yAxis.ItemsSource = gb; yAxis.Label = "{Datum}"; this.DataChart.Axes.Add(yAxis);
StackedBarSeries series2 = new StackedBarSeries();series2.SeriesCreated += series2_SeriesCreated; series2.Legend = this.xmLegend; series2.ItemsSource = gb; series2.XAxis = xAxis; series2.YAxis = yAxis; series2.AutoGenerateSeries = true; this.DataChart.Series.Add(series2);
void series2_SeriesCreated(object sender, StackedSeriesCreatedEventArgs e) { StackedFragmentSeries series = (StackedFragmentSeries)sender;
if (series != null) { series.Title = series.ValueMemberPath.Replace("_Hodnota", string.Empty); ; } }
Hello Jan,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Hi Stefan.
Thanks for your quick reaction.
I study your sample and i found error in my code, so everithing is perfekt now.
Problem is in line
yAxis.Label = "{Datum}"
Right is:
yAxis.Label = "{Key}";
Thank you for your post. I have been looking into it and I created a sample project for following your scenario and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.