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

Line Chart - Y Data Duplicates in First X Axis

1 Answer 51 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Robert Kaucher
Top achievements
Rank 2
Robert Kaucher asked on 06 Jan 2011, 03:08 PM
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: http://img12.imageshack.us/img12/3365/linecharproblem.png

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)
{
    seriesSet.Add(
        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;
radChart1.DefaultView.ChartArea.DataSeries.Add(seriesSet);

1 Answer, 1 is accepted

Sort by
0
Evgeni "Zammy" Petrov
Telerik team
answered on 10 Jan 2011, 08:47 AM
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.

Greetings,
Evgeni "Zammy" Petrov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
Chart
Asked by
Robert Kaucher
Top achievements
Rank 2
Answers by
Evgeni "Zammy" Petrov
Telerik team
Share this question
or