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

Remove value 0 on XAxis

1 Answer 37 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paulo
Top achievements
Rank 1
Paulo asked on 16 Apr 2013, 06:10 PM
I have a chart with Date series. When I don't have a value, on the xaxis ploat a value 0. How can i do to remove when the value = 0?

 

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 19 Apr 2013, 01:17 PM
Hi Paulo,

I assume when you say that you don't have a value, you mean that the property of the business object is nullable and returns null instead of a valid value such as 0.

In this case, you can hide each item that corresponds to an empty value after the chart has been data bound:
void RadChart_DataBound(object sender, EventArgs e)
{
    foreach (var item in this.RadChart.Series[0].Items)
    {
        item.Label.Visible = !item.Empty;
    }
}

If you want to hide items that actually correspond to 0 rather than null, you should, naturally, set the labels' visibility depending on whether the item.YValue property is 0.

All the best,
Ivan N.
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Paulo
Top achievements
Rank 1
Answers by
Missing User
Share this question
or