Is there anyway to hide data points with zero (0) value in a line or bar grid? I'm currently using the chart MVC extensions and can't seem to find an easy way to do this. Basically a line shows up at the 0 value on the graph and I rather not show the line at all. Any help wout be greatly appreciated.
6 Answers, 1 is accepted
Telerik does not guarantee replies to forum posts. If you need guaranteed reply from Telerik consider opening a support ticket.
I think that we need to show any valid number in the line chart(including 0). For example:
<%= Html.Telerik().Chart() .Name("chart") .Series(series => { series.Line(new int? [] { 1, 0, 1 }); }) .ValueAxis(v => v.Numeric().Min(-10))%>If you don't want to have a point in your line chart you need to set value "null" for that point. You can examine this online demo for more information. Kind regards,
Hristo Germanov
the Telerik team
Thanks for the reply! Good to see someone is out there. I'm a bit confused when you say "to show any valid number". I actually don't want to show it, rather I want to hide it. So are you saying that if the number is not part of the range then it won't show? Also if I set the min value to -10 wouldn't that include 0? I tried setting the value to null but then my charts started shifting the X axis values to the left so the graph was wrong.
Thanks again!
1) Hiding a point with value 0 is not possible with the current implementation of the chart. We will consider adding this feature.
2) If you have a range from 10 to -10(for example) the value 0 is in this range and we will show it.
3) I can't understand this: "I tried setting the value to null but then my charts started shifting the X axis values to the left so the graph was wrong." Can you examine this and tell me what is different in your case? Or you can simply modify it with your current scenario.
Hristo Germanov
the Telerik team
What if my range was from 1 to long.Max will that then hide the zero value?
I'll take a look the link and get back to you on whether it worked or not.
Thanks!
Unfortunately we will not hide this value in the line chart. This is a known issue and we will try to fix this problem as soon as we can. Until then the workaround is to set null instead of 0. Please accept our apologies for the inconvenience this may cause.
Kind regards,Hristo Germanov
the Telerik team