This is a migrated thread and some comments may be shown as answers.

Unrelated series in the same chart

1 Answer 102 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Sylvain
Top achievements
Rank 1
Sylvain asked on 08 Feb 2018, 08:54 PM

Hi,

 

I have a chart displaying the number of firm and speculative hours (area series). To do this, I retrieve my data from my controller and apply a grouping on the type (firm or speculative) and display stacked series using:

series.Area(model => model.Loe).Name("#= group.value #").CategoryField("YearMonth").Stack(true);

 

All work well but now, I want to add a new series displaying the work force(Data come from the same source) using:

series.Line(model => model.Capacity).Name("Capacity").CategoryField("YearMonth").Aggregate(ChartSeriesAggregate.Sum);

 

but the new series are added for each group. What I want is the new series appears only 1 times not for each group.

How I can do this?

 

Sylvain

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 13 Feb 2018, 04:33 PM
Hello Sylvain,

When you apply grouping in the Chart DataSource, it groups the entire data, so all series that you add to this Chart will display grouped. You can instead consider re-working the data on the server to have one data point per YearMonth value and place both the firm and speculative hours values in the same data point to avoid the need to apply grouping in the Chart DataSource.

Regards,
Tsvetina
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Chart
Asked by
Sylvain
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or