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

Line chart issue

1 Answer 61 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Grtjn
Top achievements
Rank 1
Grtjn asked on 15 Mar 2010, 11:40 AM

Hi,

I want to draw a line chart with data from my database.
I already did make a barchart this way, so I just used that code to create the linechart.

Now my problem is showing datetime on the x-axis.
This worked just fine with the barchart, but with the linechart the dates aren't shown!

 

SeriesMapping

 

smLine = new SeriesMapping();

 

smLine.ItemMappings.Add(

new ItemMapping("Percentage", DataPointMember.YValue));

 

smLine.ItemMappings.Add(

new ItemMapping("Time", DataPointMember.XValue));

 

LineChart.SeriesMappings.Add(smLine);

LineChart.DefaultSeriesDefinition =

new LineSeriesDefinition()

 

{

ShowItemLabels =

true,

 

ShowItemToolTips =

true,

 

};

LineChart.ItemsSource = e.Result;

XAxis:

 

LineChart.DefaultView.ChartArea.AxisX.Title =

"OEE & Losses";

 

LineChart.DefaultView.ChartArea.AxisX.LabelRotationAngle = 45;

LineChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat =

"HH:mm";

 

LineChart.DefaultView.ChartArea.AxisX.LayoutMode =

AxisLayoutMode.Inside;

 

1 Answer, 1 is accepted

Sort by
0
Grtjn
Top achievements
Rank 1
answered on 16 Mar 2010, 10:11 AM
This problem has been solved.
Found some incorrect code and now everything goes just fine!

Kind regards,

Gertjan
Tags
Chart
Asked by
Grtjn
Top achievements
Rank 1
Answers by
Grtjn
Top achievements
Rank 1
Share this question
or