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

DateTimeContinuousAxis Set Range

1 Answer 71 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Kirk
Top achievements
Rank 1
Kirk asked on 12 Feb 2015, 04:08 PM
Is it possible using the DateTimeContinuousAxis to set a range? I have a graph where I am plotting points. The issue is the graph "stretches" out as you add points. So if you have 2 points it plots them both over the entire axis. What I would like to do is plot the 2 points on the beginning of the graph and leave the rest blank. I would like the axis to cover a set time range.

<telerik:RadCartesianChart x:Name="myChart">
            <chartView:LineSeries CategoryBinding="DateCategory" ValueBinding="Value1" Stroke="#880000FF" StrokeThickness="2"/>
            <chartView:LineSeries CategoryBinding="DateCategory" ValueBinding="Value2" Stroke="#8800FF00" StrokeThickness="2"/>
            <chartView:LineSeries CategoryBinding="DateCategory" ValueBinding="Value3" Stroke="#88FF0000" StrokeThickness="2"/>
 
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Horizontal"/>
            </telerik:RadCartesianChart.Behaviors>
            <telerik:RadCartesianChart.HorizontalAxis>
                <chartView:DateTimeContinuousAxis MajorStepUnit="Hour"
                                                LabelInterval="10"
                                                LabelFormat="HH:mm:ss" FontFamily="Segoe UI"
                                                PlotMode="OnTicks" LabelFitMode="Rotate" MaximumTicks="31" />
            </telerik:RadCartesianChart.HorizontalAxis>
 
            <telerik:RadCartesianChart.VerticalAxis>
                <chartView:LinearAxis x:Name="VerticalAxis" FontFamily="Segoe UI" Minimum="-5" Maximum="5"/>
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Grid>
                <chartView:CartesianChartGrid MajorLinesVisibility="Y" MajorYLineDashArray="3,4" />
            </telerik:RadCartesianChart.Grid>
        </telerik:RadCartesianChart>
    

1 Answer, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 13 Feb 2015, 11:42 AM
Hi Kirk,

You can set the range of your axis by using the Minimum, Maximum and MajorStep properties. You should also specify an appropriate MajorStepUnit value which I see you have already set.

For instance:
<telerik:RadCartesianChart.HorizontalAxis>
    <telerik:DateTimeContinuousAxis Minimum="2010-7-5" Maximum="2015-7-10" MajorStepUnit="Day" MajorStep="360"/>
</telerik:RadCartesianChart.HorizontalAxis>

Regards,
Peshito
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart
Asked by
Kirk
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Share this question
or