Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
435
StackedBarSeries and Axes label
posted

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); ;
  }
}