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
200
StackedColumn not displaying all of the labels
posted

Hello,

I recently start using the wpf component, still in the learning fase:).
I want to make a stackedcolumn chart by databinding some data to it

It works, but i only see for the first serie the correct label the other series dont have any label.

 

the code i am using is all in c#, the xaml only consist of declaring the chart.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

this

 

 

 

.stackedChart.Series.Clear();

 

 

 

this

.stackedChart.Axes.Clear();

 

 

 

this.stackedChart.View3D = true

;

 

 

 

var

persons = _totalTicketsPerPersonModel.TicketList.GroupBy(t => t.LineName).ToList();

 

 

 

foreach (var person in

persons)

{

 

 

 

Series serie = new Series

();

serie.ChartType =

 

 

ChartType

.StackedColumn;

serie.DataMapping =

 

 

"Label = Day; Value = NumberOfTickets"

;

serie.Label = person.Key;

 

 

 

ObservableCollection<TotalTicketsPerPersonModel.TicketData> col = new ObservableCollection<TotalTicketsPerPersonModel.TicketData

>();

 

 

 

var

tmp = _totalTicketsPerPersonModel.TicketList.Where(l => l.LineName == person.Key).ToList();

 

 

 

foreach (var a in

tmp)

{

col.Add(a);

}

serie.DataSource = col;

 

 

 

this

.stackedChart.Series.Add(serie);

}

 

 

 

var axe = new Infragistics.Windows.Chart.Axis

();

axe.Label.Format =

 

 

"{0:MM-dd-yy}"

;

axe.AxisType = Infragistics.Windows.Chart.

 

 

AxisType

.PrimaryX;

axe.Label.FontFamily =

 

 

new FontFamily("Arial"

);

axe.Label.FontSize = 14.0;

axe.Label.Foreground = System.Windows.Media.

 

 

Brushes

.Black;