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

Hide zero points and XAxis alignment issue.

1 Answer 81 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 11 Jan 2011, 09:59 PM
Is there a way to hide the zero points of a series?

I have 2 series on the chart being populated from a single data object (which can be changed). It is showing current "production" and forcasted. Obviously current production ends "today" and I need to hide the rest of the points.  I have attached a screenshot of the current chart, everything on the red spline past the red arrow should not be displayed.

Also in the screenshot, the data label runs out of the chart area, is there a way to fix this?


Thanks for any help in advance.

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 14 Jan 2011, 12:37 PM
Hello Scott,

To hide points with YValue = 0 from your Line Series you can use one of these approaches:
1) If your chart is databound using Manual Series Mappings you can programmatically filter its data using the Filtering feature of the chart.

2) You can subscribe to ItemDataBound event of the RadChart and remove each point which has YValue = 0:
private void radChart1_ItemDataBound(object sender, ChartItemDataBoundEventArgs e)
{
 if (e.DataPoint.YValue == 0)
 {
   radChart1.DefaultView.ChartArea.DataSeries[0].Remove(e.DataPoint);
 }


Regards,
Evgenia
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
Chart
Asked by
Scott
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or