SeriesDefinition x-axis point location

6 posts, 0 answers
  1. Johannes
    Johannes avatar
    2 posts
    Member since:
    Mar 2012

    Posted 23 Mar 2012 Link to this post

    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
  2. Peshito
    Admin
    Peshito avatar
    496 posts

    Posted 28 Mar 2012 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Johannes
    Johannes avatar
    2 posts
    Member since:
    Mar 2012

    Posted 28 Mar 2012 Link to this post

    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'?
  5. Peshito
    Admin
    Peshito avatar
    496 posts

    Posted 30 Mar 2012 Link to this post

    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 >>
  6. Cédric
    Cédric avatar
    1 posts
    Member since:
    Jun 2012

    Posted 16 Jul 2014 Link to this post

    Hi Peshito,

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

  7. Peshito
    Admin
    Peshito avatar
    496 posts

    Posted 17 Jul 2014 Link to this post

    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.
     
Back to Top
UI for WPF is Visual Studio 2017 Ready