Line chart graphed incorrectly when point falls outside visible area

4 posts, 0 answers
  1. Keylight
    Keylight avatar
    6 posts
    Member since:
    Nov 2009

    Posted 25 Dec 2012 Link to this post

    I have a line chart consisting of two points that is being graphed incorrectly when one point lies outside of the visible area of the chart.  This occurs when I have the both axis' AutoRange properties set to False and I am defining my own MinValue and MaxValues.  This was tested on Q2 2012 SP2 for Silverlight 5.

    In the function below, both DataSeries represent the line y = 1 - x.

    When the function parameter useAutoRange = True, both lines are graphed correctly (see attached autorangetrue.png).  Note that since the points of both DataSeries are derived from the same equation, the lines overlap (the red line is very short in the upper left part of the chart).

    When the function parameter useAutoRange = False, the first line (blue) is NOT graphed correctly (see attached autorangefalse.png).  Note that the lines do not overlap anymore.

         Public Shared Function GetChartWithBug(useAutoRange As Boolean) As RadChart
            Dim c As New RadChart
     
            If Not useAutoRange Then
                Dim xAxis As Axis = c.DefaultView.ChartArea.AxisX
                xAxis.AutoRange = False
                xAxis.MinValue = 0
                xAxis.MaxValue = 50
                xAxis.Step = 10
     
                Dim yAxis As Axis = c.DefaultView.ChartArea.AxisY
                yAxis.AutoRange = False
                yAxis.MinValue = 0
                yAxis.MaxValue = 1
            End If
     
            Dim ds As DataSeries
     
            ds = New DataSeries
            ds.Add(New DataPoint(0, 1))
            ds.Add(New DataPoint(50, -49))
            c.DefaultView.ChartArea.DataSeries.Add(ds)
     
            ds = New DataSeries
            ds.Add(New DataPoint(0, 1))
            ds.Add(New DataPoint(1, 0))
            c.DefaultView.ChartArea.DataSeries.Add(ds)
     
            For Each ds1 As DataSeries In c.DefaultView.ChartArea.DataSeries
                Dim lsd As New LineSeriesDefinition
                lsd.ShowItemLabels = False
                lsd.ShowPointMarks = False
                ds1.Definition = lsd
            Next
     
            Return c
        End Function

  2. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 28 Dec 2012 Link to this post

    Hi Michael,

    Thank you for the sample code, this is indeed a scenario, in which the chart is not drawn correctly when a manual range is set and there are values outside of the defined range. The work-around is of course to use auto range or update the manual range.We have updated your telerik points for the feedback.

    Regards,
    Nikolay
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Keylight
    Keylight avatar
    6 posts
    Member since:
    Nov 2009

    Posted 28 Dec 2012 Link to this post

    Is this something that can be fixed by Telerik?  In my particular case, the axis min and max values will be chosen by the user, so I will need to recalculate the endpoints of my line.
  5. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 02 Jan 2013 Link to this post

    Hi,

    You can find the issue logged and track it here.

    Best regards,
    Ves
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top