xAxis datetime set range, zooming and 0 values

2 posts, 1 answers
  1. figueiredorj
    figueiredorj avatar
    68 posts
    Member since:
    Mar 2011

    Posted 18 May 2012 Link to this post

    Hi all.

    I am having some issues while configuring xAxis on radchart,
    First of all I would like to set time range in xAxis on a defined interval. Ok. I can perform that easy. I am struggling is how to configure range tickets.

    Until now it seems unable to do so.
    <telerik:ChartArea  Margin="0 10 10 10" SmartLabelsEnabled="True" NoDataString="Sem Informação para mostrar">
            <telerik:ZoomScrollSettings ScrollMode="ScrollAndZoom" />
            <telerik:AxisX IsDateTime="True"  AutoRange="False"
                           MinValue="{Binding Path=StartPeriod, Mode=TwoWay}"
                           MaxValue="{Binding Path=EndPeriod, Mode=TwoWay}"
                           Step="{Binding Path=Step, Mode=TwoWay}"
                           DefaultLabelFormat="{Binding Path=LabelFormat, Mode=TwoWay}"/>
    this is how I have it defined. However my chart appears with only 2 points: StartPeriod and EndPeriod. Where am I missing?

    Besides that, I also have a lot of info with value '0'; However it happens that my 0 values are being shown. 
    Harder than that is when I zoom on a interval where there is no sample data, it seems to break the chart and Just can't recover it. I already have set a post on this issue, but I am unsure if talking of same thing.

    Is someone that can help me out?
  2. Answer
    Rosko avatar
    137 posts

    Posted 23 May 2012 Link to this post

    Hi Ricardo,

    We understand that you want to have more than two ticks on the X Axis of your chart. In order to change the number of the ticks on the horizontal axis you should set the Step property of the X Axis. You are having only the start and the end period as tick points, because you are setting a Step value bigger than the range. If you do not wish to have the zero Y Values displayed you should set those the zeros to null values before binding the itemsource. You can find an attached sample project, regarding the two topics. Considering the last issue, it has been already deal with in the other thread.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top