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

Plotting part of a line chart?

2 Answers 76 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
hin
Top achievements
Rank 1
hin asked on 12 Sep 2012, 07:18 PM
I am creating a forecast line chart via code that show the projected amount for the whole year with actual amount for the given month in another series. 

What I want to do is hide the "future" value of the actual amount.  For example in my screenshot, I am running the graph as of July. I don't have any data from Aug - Dec so it's zero or null.  How can I have the line stop at July or make the line invisible after July?  I don't want my graph to show a big drop from July to Aug.

https://docs.google.com/open?id=0ByWuNoN2Uz2DZG5NZ25yZGlOWXM

Thanks!

2 Answers, 1 is accepted

Sort by
0
Accepted
Elian
Telerik team
answered on 17 Sep 2012, 02:26 PM
Hello Hin,

The chart series have properties which define the way null values will be handled. In order for the line to stop without reaching 0, set the following properties:
//this will connect the two points that have values != null
this.chart1.Series[0].Appearance.EmptyValue.Mode = Charting.Styles.EmtyValuesMode.Approximation;
//this will make the line invisible for the null values
this.chart1.Series[0].Appearance.EmptyValue.Line.Width = 0;
 
Kind regards,
Elian
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
hin
Top achievements
Rank 1
answered on 18 Sep 2012, 10:31 PM
Thank you Elian for pointing me in the right direction.  There was one piece of code that was missing.  I have to set the chartseriesitems to empty for this to work.

The extra code needed.

IF row("myamount") = 0 THEN
    mychartseriesitem.Empty = True
END IF
Tags
General Discussions
Asked by
hin
Top achievements
Rank 1
Answers by
Elian
Telerik team
hin
Top achievements
Rank 1
Share this question
or