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

Setting DateTimeContinuousAxis.Maximum property results in line or area series being displayed incorrectly.

1 Answer 63 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
John asked on 08 Nov 2011, 04:23 PM


I'm using the Q3 2011 beta, V1020. When setting DateTimeContinuousAxis.Maximum line or area series are displayed incorrectly, as shown in the attached screenshots.

With the line series it appears that a line is drawn up to the top left hand corner of the screen. This look very similar to the problem described in the forum posting "Line series fails to handle nulls and NaN", although in this case there are no null values.

Do you know if there is a workaround for this or if it is scheduled to be fixed? I've pasted the code below





    public class Measurement
        public DateTime StartDateTime { get; set; }
        public double Value { get; set; }

    public partial class MainPage : UserControl
        public MainPage()

            List<Measurement> measurements = new List<Measurement>();
            DateTime startDateTime = new DateTime(2010, 1, 1);
            DateTime endDateTime = new DateTime(2010, 1, 2);
            Measurement currentMeasurement = null;
            Random random = new Random();

            while (startDateTime < endDateTime)
                currentMeasurement = new Measurement()
                                             StartDateTime = startDateTime,
                                             Value = 2 + random.Next(-2, 2)

                startDateTime = startDateTime.AddHours(1);

            DateTimeContinuousAxis horizontalAxis = new DateTimeContinuousAxis()
                LabelFitMode = AxisLabelFitMode.MultiLine,
                LabelFormat = "HH:mm"

            _chart.HorizontalAxis = horizontalAxis;
            _chart.VerticalAxis = new LinearAxis();

            LineSeries categoricalSeries = new LineSeries();

            categoricalSeries.ValueBinding = new PropertyNameDataPointBinding()
                PropertyName = "Value"

            categoricalSeries.CategoryBinding = new PropertyNameDataPointBinding()
                PropertyName = "StartDateTime"

            categoricalSeries.ItemsSource = measurements;
            horizontalAxis.Maximum = new DateTime(2010, 1, 1, 22, 0, 0); // Remove this line to display series correctly.


<UserControl x:Class="TimeBarTest.MainPage"
    xmlns:mc="" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Chart" xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.DataVisualization" xmlns:TimeBar="clr-namespace:Telerik.Windows.Controls.TimeBar;assembly=Telerik.Windows.Controls.DataVisualization" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">
            <telerik:RadCartesianChart x:Name="_chart" Height="800" HorizontalAlignment="Stretch" Margin="0,10,0,0" Background="Transparent"
          BorderBrush="{x:Null}" BorderThickness="0"

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 10 Nov 2011, 12:27 PM
Hello John,

Thank you for contacting us.

Indeed we are aware of this rendering glitch that occurs if you try to restrict the visible Axis.Maximum property to a value that is less than the actual maximum value coming from the series data (in this case you have set 22h as the maximum but your last measurement is for 23h).

As a workaround at the moment we would suggest you to set the Axis.Maximum to a value that is equal or greater than the actual data maximum e.g.:
horizontalAxis.Maximum = new DateTime(2010, 1, 1, 23, 0, 0);

We have discussed the problem with our devteam and it seems unlikely that we will be able to incorporate the permanent fix for the Q3 release (scheduled for next week) but we will certainly address this problem with high priority for one of the first weekly internal builds after that (you can track the resolution progress here).

Hope this helps.

Best wishes,
the Telerik team

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

Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question