RadChart does not support rendering of series with different orientation at the same time

2 posts, 0 answers
  1. Jonathan
    Jonathan avatar
    5 posts
    Member since:
    Nov 2012

    Posted 02 Dec 2012 Link to this post

    Hi,

    I'm using version 2010.1.309.1030

    I'm trying to use a custom layout for my chart (using the default layout with identical cod in all other respects works well. However with the custom layout I get the exception "RadChart does not support rendering of series with different orientation at the same time" whenever I attempt to change the charts ItemsSource property. I never add a series definition other than HorizontalBarSeriesDefinition.

    The reason I want to use a custom layout is to have the grid style relative width layout, so the legend size changes with the windows size, so if there is a way to achieve this with the default layout, that can also be a good solution.

    The custom layout is defined like:

    <charts:RadChart x:Name="Chart" UseDefaultLayout="false">
        <charts:RadChart.DefaultSeriesDefinition>
           <charting:HorizontalBarSeriesDefinition />
        </charts:RadChart.DefaultSeriesDefinition>
         
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="3*"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
             
            <charting:ChartArea x:Name="ChartArea" LegendName="ChartLegend"  Grid.Row="0" Grid.Column="0" />
            <charting:ChartLegend x:Name="ChartLegend" UseAutoGeneratedItems="True" Grid.Row="0" Grid.Column="1" />
             
        </Grid>
    </charts:RadChart>

    And I'm adding new series like:

    SeriesMapping seriesMapping = new SeriesMapping();
    seriesMapping.ChartAreaName = ChartArea.Name;
    seriesMapping.LegendLabel = "Some Label";
    seriesMapping.SeriesDefinition = new HorizontalBarSeriesDefinition();
    seriesMapping.SeriesDefinition.ItemToolTipFormat = "#Y{#.##} % #DATAITEM.Category";
    seriesMapping.CollectionIndex = i++;
    seriesMapping.SeriesDefinition.ShowItemLabels = false;
    seriesMapping.SeriesDefinition.ShowItemToolTips = true;
    seriesMapping.ItemMappings.Add(new ItemMapping("Category", DataPointMember.XCategory));
    seriesMapping.ItemMappings.Add(new ItemMapping("Percentage", DataPointMember.YValue));
    Chart.SeriesMappings.Add(seriesMapping);

  2. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 05 Dec 2012 Link to this post

    Hi Jonathan,

    I was unable to reproduce the problem. I have attached the sample code that I used (which is based on yours). 

    This type of exception should only occur if you have mixed horizontal series with normal (vertical) ones and should not be related to the layout of the chart.

    If the problem persists, it would be helpful if you could open a support ticket and attach a sample runnable project, so we can debug locally. 

    Kind regards,
    Petar Kirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top