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

Series Aggregates and Missing points.

2 Answers 42 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Noah
Top achievements
Rank 1
Noah asked on 06 Feb 2014, 03:45 PM
I am using a line series grouped on year so i get a series for each year.  The data comes across from the read looking something like this for each data point

{Key: X, Year: 2013, Month: 11, Value: 100}
{Key: X, Year: 2013, Month: 12, Value: 120}
{Key: Y, Year: 2013, Month 11, Value: 200}
{Key: X, Year: 2014, Month 1, Value: 100}
{Key: Z, Year: 2013, Month 11, Value: 200}

The datasource is defined as:

.DataSource(ds => ds
            .Read("_getAllData", "Data")
            .Group(gg => gg.Add(m => m.Year))
            .Filter(ff => ff.Add(m => m.Key).IsEqualTo("X").Or().IsEqualTo("Y"))
                    .Sort(ss => { ss.Add(m => m.Year).Ascending(); ss.Add(m => m.Month).Ascending(); }))

So depending on what filters the user chooses, I update the filters on the data source so it could show combined data from any subset of the Keys.  The Series is defined as...

series.Line(m => m.Value, m => m.Month)
.Aggregate(ChartSeriesAggregate.Sum).MissingValues(ChartLineMissingValues.Gap);

The problem is that there are no data points for the months 2-12 in year 2014, but despite having it set to show missing points as a gap, it shows up as zero's on the chart.  However, If I don't use the aggregate and only show the values for one Key then the missing points in 2014 are correctly shown as gaps.  Is this an unavoidable consequence of using the Aggregate, or is there a way to get it to not show points for which the aggregate is NULL instead of treating it as a 0?

2 Answers, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 10 Feb 2014, 05:35 PM
Hi Noah,

I am afraid this scenario is not supported by Kendo UI Chart for ASP.NET MVC. Please accept my apologies for any inconvenience this may cause.

Regards,
Iliana Nikolova
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
Travis
Top achievements
Rank 1
answered on 09 Jan 2019, 09:26 PM
When using Kendo UI, "gap" will work if you set the aggregate to "sumOrNull".
Tags
Charts
Asked by
Noah
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Travis
Top achievements
Rank 1
Share this question
or