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

How do you set minimum for Y-Scale (regular way does not work)

11 Answers 89 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Maciej Pilichowski
Top achievements
Rank 1
Maciej Pilichowski asked on 30 Sep 2010, 08:17 AM

I have RadChart with 30 items on X scale. They all have values 0, and I am not showing it (visible=false). I am doing it because I would like to show empty char, but with correct scale (if you don't add any items, there will be red label in center with text about missing data).

So far, so good. But the problem is the chart Y scale goes by default from -50 to +50. And now is my question -- how do you change it, to go from 0, to default (50 is fine)?

I added in ascx file the tags

<PlotArea>

<YAxis2 MinValue=0></YAxis2>
<YAxis MinValue=0></YAxis>

</PlotArea>

It does not work. So I added the equivalent of this in C# code, just after adding data. Still, no change. So how do you set this min value for Y scale?

11 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 30 Sep 2010, 03:33 PM
Hi Maciej,

The RadChart is calculating the Axis Range by taking the zero and data values. In your case where all the values are zeroes RadChart can't find two points to calculate range from them. That's why it is showing -50.. 50 on YAxis. You can easily change this by setting AutoScale to False and manually set the MinValue, MaxValue and Step. For example MinValue=0; MaxValue =50 and Step =10. For more information take a look at our help topic - http://www.telerik.com/help/aspnet-ajax/understandingelementsaxes.html.

I hope this helps.

Regards,
Evgenia
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Maciej Pilichowski
Top achievements
Rank 1
answered on 01 Oct 2010, 05:47 AM
Uh-oh, thank you. I missed AutoScale property. Problem solved.
0
eugen100
Top achievements
Rank 1
answered on 28 May 2011, 11:07 AM
Hello,
My question is close to the theme of this thread so I decided do not open a new one. I have, for example, XValues of a series as
[-5,...,5]. If I use AutoLayout="true" then I get on Xaxis exactly these bounds. But if, for example,XValues  are between 2 and 5 then in Radchart I get a zero as a left bound of Xaxis. I know that I can change "AutoScale to False and manually set the MinValue, MaxValue and Step". But in these case I lose all preferences of  AutoLayout="true". Is it possible to find other soluton so that I won't lose power of AutoScale ?
0
Evgenia
Telerik team
answered on 31 May 2011, 02:33 PM
Hi Evgeny,

We are not able to reproduce such behavior - "lose the preferences of AutoLayout turned on when AutoScale is false".
The sample project attached is created with the latest binaries of our control and everything works as expected.

All the best,
Evgenia
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
eugen100
Top achievements
Rank 1
answered on 01 Jun 2011, 07:13 AM
Hi Evgenia ,
I think that I understood your point:
 If we want that XAxis bounds will be according to xmin,xmax and not include zero
we should define
AutoScale = false
and
XAxis.AddRange(xmin,xmax,step)
It supposes that we define step ourselves. I really wanted to avoid this that is I thought that

AutoLayout =

true

 

will make it. But it seems that avoiding of step defining (by computing it according to bounds (xmin,xmax)) is not impossible.
Thank you
Evgeny
0
Evgenia
Telerik team
answered on 03 Jun 2011, 03:10 PM
Hello Evgeny,

AutoLayout property functionality instructs the control to perform layout arrangement automatically for optimal utilization of the elements. It has nothing in common with the Axes - it just controls the appearance of the elements that are not part of the PlotArea (Chart Title, Legend and Axis Labels).
Even if you provide only the MinValue and MaxValue values for the XAxis without specifying the Step - it will be automatically set to 1 (the default value).

Kind regards,
Evgenia
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
eugen100
Top achievements
Rank 1
answered on 05 Jun 2011, 07:48 AM
Hello Evgenia.
You wrote:
>Even if you provide only the MinValue and MaxValue values for the XAxis without specifying the Step - it will be automatically set to 1 (the default value).
Exactly, and this is my point: step equal to 1 is not acceptable for big range. So I should compute and set it by myself. I don't say that it is bug - it is a feature.  But if you should not always include zero into X range when  AutoLayout="true" and AutoScale=true then I wouldn' t change AutoScale to false and so I would not have to compute the step.
Thank you
Evgeny
0
Evgenia
Telerik team
answered on 08 Jun 2011, 10:27 AM
Hi Evgeny,

I'm afraid I don't understand your frustrations. AutoLayout property works independently from the AutoScale property - no matter if you provided custom Range or automatic Range for the Axes. For all our users that want to avoid the 0 value to be plotted - they can set custom Range for the Axes and yes they should calculate the Step on their own.
Once again - the AutoLayout property does not controls the Step of the axes.

Kind regards,
Evgenia
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
eugen100
Top achievements
Rank 1
answered on 09 Jun 2011, 09:06 PM
Hello Evgenia,
I think that I understood you: only AutoScale property controls the Step of the axes. So "my frustrations" is about: why AutoScale =true does include zero  to be plotted ? It might be more comfortable if xMin and xMax were defined automatcally.
Thank you
Evgeny
0
Evgenia
Telerik team
answered on 15 Jun 2011, 09:10 AM
Hi Evgeny,

I'm sorry for omitting to mention the IsZeroBased property of the Chart. You can set it to false and this way the zero won't be displayed. This property works only when the AutoScale is set to true.

I hope this helps you.

Kind regards,
Evgenia
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
eugen100
Top achievements
Rank 1
answered on 24 Jun 2011, 07:55 AM
Thank you, it really helps.
Tags
Chart (Obsolete)
Asked by
Maciej Pilichowski
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Maciej Pilichowski
Top achievements
Rank 1
eugen100
Top achievements
Rank 1
Share this question
or