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

Hiding line on graph if value is 0

3 Answers 259 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 22 Apr 2015, 09:56 PM

I've tried everything I can come up with to do this simple task:

Basic line graph with one category and 2 line series.  One line shows a sales value and the other shows budgeted sales.  Budgeted sales goes to the end of the year and the sales line becomes 0 after the current date.  I've tried to use conditional formatting on the line series to hide the line on 0 values but it doesn't work. How do I make the line stop and hide the rest instead of showing a drop down to 0?

Thanks,

Chris.

 

 

3 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 22 Apr 2015, 10:19 PM

New Information:

Looks like conditional formatting works (sort of).  It appears to apply the formatting from that point forward and not the line leading from the previous point to the current point.  So the line is hidden but you can't really see it because its on the x-axis when it's 0 but the line that drops down to 0 is still showing.

0
Chris
Top achievements
Rank 1
answered on 23 Apr 2015, 04:30 PM
I'm still unable to hide the line with a 0 value, I was able to accomplish this by changing my business object to have nullable values.  Changing the 0's to nulls caused the line to end where it should.
0
Ivan Hristov
Telerik team
answered on 27 Apr 2015, 06:33 AM
Hi Chris,

We're glad that you managed to resolve your issue. Actually we were about to advise you the same thing - replace the values that shouldn't be shown with nulls. However, if in other scenarios you can't change your business object, you can apply a simple IIF expression to the values on the Y axis, replacing the actual value with NULL like this:
[Series.Y] = IIF(Fields.Y = 0, null, Fields.Y);

Please keep in mind that if your data contains points with valid Y values after the ones with NULL Y values, the graph processing engine will skip the NULL ones and just connect the two valid points. In this case we suggest you to prepare your data in advance, creating groups for non-null chunks of data and then create series group by that field. The idea is to divide the "valid" portions of your data and assign to each one of them a value that could be used to distinguish them later. 

Hope it helps.

Regards,
Ivan Hristov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
General Discussions
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Ivan Hristov
Telerik team
Share this question
or