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

SeriesDefinition x-axis point location

5 Answers 77 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Johannes
Top achievements
Rank 1
Johannes asked on 23 Mar 2012, 12:15 PM
I have a chart with several data series (types BarSeriesDefinition and StepLineSeriesDefinition, see attachment). The x-axis holds discrete DateTime values in a monthly interval.

I have the following issue:
The step line data points are located in the centre of the x-axis data points (e.g. the red step line changes its y-axis value for february at the position of the blue bar, which is in the centre of the x-axis data point.).

I need the step line data points to be located at the beginning of the x-axis data points instead of the centre.

I create the data series dynamically in code behind, simplified e.g:

// Create mapping.
SeriesMapping newMapping = new SeriesMapping();
  
// Create series definition.
StepLineSeriesDefinition series = new StepLineSeriesDefinition();
newMapping.SeriesDefinition = series;
  
newMapping.ItemsSource = items;
newMapping.ItemMappings.Add(new ItemMapping(xAxisCategoryKey, DataPointMember.XCategory));
newMapping.ItemMappings.Add(new ItemMapping(yAxisKey, DataPointMember.YValue));
  
// Add mapping to chart.
this._radChart.SeriesMappings.Add(newMapping);

Is there a solution for this problem (I am quite new to wpf and telerik)?

Thanx for ur help

Johannes

5 Answers, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 28 Mar 2012, 08:21 AM
Hello Johannes,

You can accomplish that by using the AxisX LayoutMode property like this:
radchart.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Normal;

More about layout modes can be found here:
http://www.telerik.com/help/wpf/radchart-features-layout-mode.html

Regards,
Peshito
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Johannes
Top achievements
Rank 1
answered on 28 Mar 2012, 09:58 AM
Hi Peshito,

thank you for the reply. Unfortunately this doesn't solve my problem.

The lines are now displayed correct, but the bars should stay the layout mode they were.
The lines should change they y values at the beginning of the first bar of each x-axis data point.

Is there a way to set the layout mode for the lines to 'normal' and keep the layout mode for the bars in mode 'between'?
0
Peshito
Telerik team
answered on 30 Mar 2012, 03:24 PM
Hi Johannes,

You are welcome.

Regarding your question, this is not supported. You can only change the layout of the axis which affects all chart series.

All the best,
Peshito
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Cédric
Top achievements
Rank 1
answered on 16 Jul 2014, 01:04 PM
Hi Peshito,

we are encountering the same problem. Did you find anyway to fix this situation?

0
Peshito
Telerik team
answered on 17 Jul 2014, 08:30 AM
Hello,

Our efforts are concentrated on improving the newer ChartView control. In case you are just starting with the chart, I would suggest you to use the ChartView instead of the older RadChart control, where this is not supported and you can only change the layout of the axis which affects all chart series.

In case you decide to go with the newer chart control, each series can have its own axis and you can use the plot mode of the axis i order to change the layout according to the series you have.

Hope this helps.

Regards,
Peshito
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Chart
Asked by
Johannes
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Johannes
Top achievements
Rank 1
Cédric
Top achievements
Rank 1
Share this question
or