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

Thread is closed for posting
6 posts, 1 answers
  1. Ram
    Ram avatar
    97 posts
    Member since:
    Jun 2011

    Posted 28 Sep 2011 Link to this post

    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>
  2. Answer
    Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 30 Sep 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ram
    Ram avatar
    97 posts
    Member since:
    Jun 2011

    Posted 30 Sep 2011 Link to this post

    Hi
    Thank you very much.
    With you answer I was able to decorate my chart in the way I wanted.
  5. Karuna
    Karuna avatar
    5 posts
    Member since:
    Mar 2012

    Posted 11 Jan 2013 Link to this post

    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.
  6. FISCAL
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 14 Jan 2013 Link to this post

    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
  7. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 16 Jan 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017