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

2 posts, 1 answers
  1. John
    John avatar
    1 posts
    Member since:
    Aug 2010

    Posted 08 Nov 2011 Link to this post


    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"

  2. Answer
    Giuseppe avatar
    2363 posts

    Posted 10 Nov 2011 Link to this post

    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 >>

Back to Top