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

[Solved] Hide Zero values in a chart

6 Answers 51 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
danny
Top achievements
Rank 1
danny asked on 01 Aug 2012, 10:11 PM
Hi -

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

Sort by
0
danny
Top achievements
Rank 1
answered on 22 Aug 2012, 01:48 PM
No answer in almost a month really? 
0
Hristo Germanov
Telerik team
answered on 24 Aug 2012, 10:51 AM
Hello Danny Alcantara,

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))
%>
I don't know why we need to skip it.

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
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
danny
Top achievements
Rank 1
answered on 24 Aug 2012, 04:23 PM
Hi Hristo!

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!
0
Hristo Germanov
Telerik team
answered on 29 Aug 2012, 01:55 PM
Hello Danny,

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.

Regards,
Hristo Germanov
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
0
danny
Top achievements
Rank 1
answered on 29 Aug 2012, 01:58 PM
Hi Hristo -

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!
0
Hristo Germanov
Telerik team
answered on 29 Aug 2012, 03:51 PM
Hello Danny Alcantara,

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
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
Chart
Asked by
danny
Top achievements
Rank 1
Answers by
danny
Top achievements
Rank 1
Hristo Germanov
Telerik team
Share this question
or