Line Chart - Y Data Duplicates in First X Axis

2 posts, 0 answers
  1. Robert Kaucher
    Robert Kaucher avatar
    56 posts
    Member since:
    Oct 2010

    Posted 06 Jan 2011 Link to this post

    I have a RadChart configured to display total sales in dollars by year. The issue is the first two years' data overlap in the display causing the following years to be displayed in the wrong areas. I can only imagine this is something simple that I am overlooking.

    Here is a screen shot:

    Here is my code:
    //Line chart
    radChart1.DefaultView.ChartLegend.UseAutoGeneratedItems = true;
    DataSeries seriesSet = new DataSeries();
    seriesSet.Definition = new LineSeriesDefinition();
    SolidColorBrush lineChartColor = GetColorFromHexa("#ff000066");
    seriesSet.Definition.Appearance.Fill = lineChartColor;
    //Axis X
    radChart1.DefaultView.ChartArea.AxisX.AutoRange = true; 
    radChart1.DefaultView.ChartArea.AxisX.Step = 1;
    radChart1.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "0";
    radChart1.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Between;
    //Axis Y
    radChart1.DefaultView.ChartArea.AxisY.Title = "Dollars";
    radChart1.DefaultView.ChartArea.AxisY.DefaultLabelFormat = "0";
    foreach (var item in _vm.workingPart.PartsSold)
            new DataPoint(
                          (double)item.Item1, //Year
                          (double)item.Item4 //Amount of sales
    foreach (var item in seriesSet)
        item.LabelFormat = "#Y{C}";
    radChart1.DefaultView.ChartLegend.Visibility = Visibility.Collapsed;
  2. Evgeni "Zammy" Petrov
    Evgeni "Zammy" Petrov avatar
    168 posts

    Posted 10 Jan 2011 Link to this post

    Hello Robert,

     I do not see anything wrong in your code. 
    Can we see the data? I assume the data is problematic. You can open a formal support ticket, and send us a small working project, demonstrating your logic, along with the problematic behavior, for additional review and testing.

    Evgeni "Zammy" Petrov
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top