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

xAxis datetime set range, zooming and 0 values

1 Answer 70 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.
figueiredorj
Top achievements
Rank 1
figueiredorj asked on 18 May 2012, 04:42 PM
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:ChartArea.ZoomScrollSettingsX>
        <telerik:ZoomScrollSettings ScrollMode="ScrollAndZoom" />
    </telerik:ChartArea.ZoomScrollSettingsX>
    <telerik:ChartArea.AxisX>
        <telerik:AxisX IsDateTime="True"  AutoRange="False"
                       MinValue="{Binding Path=StartPeriod, Mode=TwoWay}"
                       MaxValue="{Binding Path=EndPeriod, Mode=TwoWay}"
                       Step="{Binding Path=Step, Mode=TwoWay}"
                       LayoutMode="Auto"
                        
                       DefaultLabelFormat="{Binding Path=LabelFormat, Mode=TwoWay}"/>
    </telerik:ChartArea.AxisX>
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.
http://www.telerik.com/community/forums/silverlight/chart/exception-when-add-marked-zone-but-data-has-only-zero-points.aspx 

Is someone that can help me out?
Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosko
Telerik team
answered on 23 May 2012, 01:12 PM
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,
Rosko
the Telerik team

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

Tags
Chart
Asked by
figueiredorj
Top achievements
Rank 1
Answers by
Rosko
Telerik team
Share this question
or