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

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

1 Answer 30 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 02 Dec 2012, 08:37 AM
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);

1 Answer, 1 is accepted

Sort by
0
Petar Kirov
Telerik team
answered on 05 Dec 2012, 03:36 PM
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.

Tags
Chart
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Share this question
or