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

Line chart graphed incorrectly when point falls outside visible area

3 Answers 28 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Keylight
Top achievements
Rank 1
Keylight asked on 25 Dec 2012, 11:35 PM
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

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 28 Dec 2012, 07:44 AM
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.

0
Keylight
Top achievements
Rank 1
answered on 28 Dec 2012, 10:46 PM
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.
0
Ves
Telerik team
answered on 02 Jan 2013, 09:10 AM
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.

Tags
Chart
Asked by
Keylight
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Keylight
Top achievements
Rank 1
Ves
Telerik team
Share this question
or