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

Show only positive values(from 0 to n) for Y-Axis

5 Answers 109 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Ram
Top achievements
Rank 1
Ram asked on 28 Sep 2011, 06:32 AM
Hi All,
I'm using radchart in my application in my asp.net application.
Im binding the serieses with lists<int> from code behind.
If the all the values of list are zero then line horizental plain line showing at the zero postion of y axis.
But In Y axis its showing the negattive values also like 0 -10 -20 .....
I want to show the only positive values starting from 0 to....
And how to increase the height and width of plot area.
Please see the attached pic.
Please help me as early as possible.
<telerik:RadChart ID="trndChrt" runat="server"  SeriesOrientation="Vertical" ChartTitle-Visible="false"
                   SkinsOverrideStyles="true" CreateImageMap="false" width="770px" Height="278px">
           <Series>
           <telerik:ChartSeries Type="Line" Name="PTT">
               <Appearance BarWidthPercent="90" LabelAppearance-Visible="false">
                   <FillStyle FillType="Solid" MainColor="#000099">
                   </FillStyle>
                    <PointMark Visible="True" Border-Width="1" Border-Color="Red" Dimensions-AutoSize="false"
                           Dimensions-Height="3px" Dimensions-Width="4px">
                           <FillStyle MainColor="Yellow" FillType="solid">
                           </FillStyle>
                       </PointMark>
                       <EmptyValue Mode="Zero" Line-Color="Transparent">
                       </EmptyValue>
               </Appearance>
           </telerik:ChartSeries>   
           <telerik:ChartSeries Type="Line" Name="VOX" Appearance-LegendDisplayMode="SeriesName">
               <Appearance BarWidthPercent="90" LabelAppearance-Visible="false">
                   <FillStyle FillType="Solid" MainColor="Black">
                   </FillStyle>
                   <PointMark Visible="True" Border-Width="1" Border-Color="Red" Dimensions-AutoSize="false"
                           Dimensions-Height="3px" Dimensions-Width="4px">
                           <FillStyle MainColor="Yellow" FillType="solid">
                           </FillStyle>
                       </PointMark>
               </Appearance>
           </telerik:ChartSeries>
           <telerik:ChartSeries Type="Line" Name="State Change">
               <Appearance BarWidthPercent="90" LabelAppearance-Visible="false">
                   <FillStyle FillType="Solid" MainColor="#f85007">
                   </FillStyle>
                   <PointMark Visible="True" Border-Width="1" Border-Color="Red" Dimensions-AutoSize="false"
                           Dimensions-Height="3px" Dimensions-Width="4px">
                           <FillStyle MainColor="Yellow" FillType="solid">
                           </FillStyle>
                       </PointMark>
               </Appearance>
           </telerik:ChartSeries>
           <telerik:ChartSeries Type="Line" Name="Active Dispatchers">
               <Appearance BarWidthPercent="90" LabelAppearance-Visible="false">
                   <FillStyle FillType="Solid" MainColor="#cc00ff">
                   </FillStyle>
                   <PointMark Visible="True" Border-Width="1" Border-Color="Red" Dimensions-AutoSize="false"
                           Dimensions-Height="3px" Dimensions-Width="4px">
                           <FillStyle MainColor="Yellow" FillType="solid">
                           </FillStyle>
                       </PointMark>
               </Appearance>
           </telerik:ChartSeries>
           <telerik:ChartSeries Type="Line" Name="Calls">
               <Appearance BarWidthPercent="90" LabelAppearance-Visible="false">
                   <FillStyle FillType="Solid" MainColor="#339933">
                   </FillStyle>
                   <PointMark Visible="True" Border-Width="1" Border-Color="Red" Dimensions-AutoSize="false"
                           Dimensions-Height="3px" Dimensions-Width="4px">
                           <FillStyle MainColor="Yellow" FillType="solid">
                           </FillStyle>
                       </PointMark>
               </Appearance>
           </telerik:ChartSeries>
       </Series>
       <PlotArea Appearance-FillStyle-MainColor="White" XAxis-LayoutMode="Normal" XAxis-Appearance-MajorTick-Visible="false" YAxis-Appearance-MajorTick-Visible="false" YAxis-Appearance-MinorTick-Visible="false" EmptySeriesMessage-Appearance-Visible="false" Appearance-Border-Color="Black"  Appearance-FillStyle-FillType="Solid" DataTable-Appearance-CellWidth="200" EmptySeriesMessage-Visible="false" XAxis-Appearance-MajorGridLines-Color="#d2d2d2" XAxis-Appearance-MajorGridLines-PenStyle="Solid" XAxis-Appearance-MajorGridLines-Width="1">
       </PlotArea>
       <Legend Visible="false">
       </Legend>       
      </telerik:RadChart>

5 Answers, 1 is accepted

Sort by
0
Accepted
Evgenia
Telerik team
answered on 30 Sep 2011, 12:15 PM
Hello Ram,

You can control the YAxis Items Labels that should be displayed by turning off the AutoScale property and providing your own Step, MinValue and MaxValue.
You can also change the Width and Height of the PlotArea like this:

RadChart1.PlotArea.Appearance.Dimensions.AutoSize = false;
RadChart1.PlotArea.Appearance.Dimensions.Height = 100;
RadChart1.PlotArea.Appearance.Dimensions.Width = 100;

Best wishes,
Evgenia
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
0
Ram
Top achievements
Rank 1
answered on 30 Sep 2011, 02:14 PM
Hi
Thank you very much.
With you answer I was able to decorate my chart in the way I wanted.
0
Karuna
Top achievements
Rank 1
answered on 11 Jan 2013, 06:40 AM
Hi Evgenia,

I have the same problem Ram faced. 
But Max value may vary... Is there any other way without setting Auto Scale to false , Step, Min and Max values.

Your help is highly appreciated.

Thanks,
Karuna.
0
FISCAL
Top achievements
Rank 1
answered on 14 Jan 2013, 10:01 AM
I am interested in the same feature requested by Karuna. I know something like this is possible with the new Chart control in SIlverlight, did you bring it across into asp?

Thanks,

Michele
0
Yavor
Telerik team
answered on 16 Jan 2013, 07:41 AM
Hi,

Presently, in the asp.net ajax component you have these two options - either let the control autosize the axis, or set the range manually, as mentioned previously. This can also be done dynamically - for example, you can check the data, and then set the min/max/step.
Other than this, there is no other way to handle this task. I hope that one of these options is suitable for you.

Kind regards,
Yavor
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
Chart (Obsolete)
Asked by
Ram
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Ram
Top achievements
Rank 1
Karuna
Top achievements
Rank 1
FISCAL
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or