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

NULL[empty, missing] values on line chart

1 Answer 76 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Fum
Top achievements
Rank 1
Fum asked on 30 Jan 2015, 05:33 AM
Hi, I'm new to Telerik and I had a questions.

I've created a line chart with date values along the x-axis and data along the y-axis.

Some of the data values are missing,
yet I'd still like to connect the points,
from the first data point through to the last without a break in the line.

Is there a way to connect lines through null values?

If I had all the values for a given data set,
it'd look like this:
1----2----3----4----5

With missing values,
Ideally, it'd look like this: *in case missing the 3rd value
1----2---------4----5

But when generating the chart with missing values,
I receive a error.


I hope solution like this. *UI for Silverlight Forum
http://www.telerik.com/forums/dotted-line-for-empty-null-values#pQZPFuDYb0eurGMcrM5V-A

Thank you.

1 Answer, 1 is accepted

Sort by
0
Adrian
Telerik team
answered on 30 Jan 2015, 04:16 PM
Hello Fum,

Thank you for contacting us.

Currently ignoring nil data values is not available out of the box. To achieve the desired scenario you should filter your data manually and create line series with the filtered data set. Please consider the code snippet below:
for (int i = 0; i < values.count; i++) {
    TKChartDataPoint *point = [TKChartDataPoint dataPointWithX:[NSDate dateWithTimeInterval:i * 60 * 60 sinceDate:now] Y:values[i]];
    if ([point.dataYValue isEqual:[NSNull null]]) {
        continue;
    }
         
    [dataPoints addObject:point];
}

This seems to be a reasonable feature and we will consider implementing it. I logged it in our feedback portal. Feel free to vote/comment there. I also updated your Telerik points for this suggestion.

I will be glad to assist you if you have further questions.

Regards,
Adrian
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart
Asked by
Fum
Top achievements
Rank 1
Answers by
Adrian
Telerik team
Share this question
or