Extra Chart area in Chart.

2 posts, 0 answers
  1. Eric
    Eric avatar
    14 posts
    Member since:
    Jun 2012

    Posted 08 Nov 2011 Link to this post

    Here is a Chart I'm working on: 

    <Telerik:RadChart Height="750" x:Name="WeightsChart" Width="1400">
        <Telerik:RadChart.DefaultView>
            <Telerik:ChartDefaultView>
                <Telerik:ChartDefaultView.ChartTitle>
                    <Telerik:ChartTitle Content="Catia Part and Assembly Weights" HorizontalAlignment="Center"/>
                </Telerik:ChartDefaultView.ChartTitle>
                <Telerik:ChartDefaultView.ChartLegend>
                    <Telerik:ChartLegend Visibility="Collapsed"/>
                </Telerik:ChartDefaultView.ChartLegend>
                <Telerik:ChartDefaultView.ChartArea>
                    <Telerik:ChartArea>
                        <Telerik:ChartArea.AxisX>
                            <Telerik:AxisX LabelRotationAngle="90"/>
                        </Telerik:ChartArea.AxisX>
                    </Telerik:ChartArea>
                </Telerik:ChartDefaultView.ChartArea>
            </Telerik:ChartDefaultView>
        </Telerik:RadChart.DefaultView>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>
            <Telerik:ChartArea x:Name="BarChart" NoDataString="No Bar Series Data"/>
            <Telerik:ChartArea x:Name="LineChart" Grid.Row="1" NoDataString="No Line Series Data"/>
        </Grid>
        <Telerik:RadChart.HierarchicalViewDescriptors>
            <!--Bar Chart Descriptors-->
            <Telerik:ChartHierarchicalViewDescriptor>
                <Telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
                    <Telerik:SeriesMapping LegendLabel="Weights" ChartAreaName="BarChart">
                        <Telerik:SeriesMapping.SeriesDefinition>
                            <Telerik:BarSeriesDefinition LegendDisplayMode="None"
                                                     ItemStyle="{StaticResource BarStyle}"
                                                     SeriesItemLabelStyle="{StaticResource LabelStyle}">
                            </Telerik:BarSeriesDefinition>
                        </Telerik:SeriesMapping.SeriesDefinition>
                        <Telerik:SeriesMapping.ItemMappings>
                            <Telerik:ItemMapping FieldName="Weight" DataPointMember="YValue"/>
                            <Telerik:ItemMapping FieldName="InstanceNumber" DataPointMember="XCategory"/>
                        </Telerik:SeriesMapping.ItemMappings>
                    </Telerik:SeriesMapping>
                </Telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
            </Telerik:ChartHierarchicalViewDescriptor>
            <Telerik:ChartHierarchicalViewDescriptor>
                <Telerik:ChartHierarchicalViewDescriptor.Relation>
                    <Telerik:PropertyRelation ParentPropertyName="Children"/>
                </Telerik:ChartHierarchicalViewDescriptor.Relation>
                <Telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
                    <Telerik:SeriesMapping LegendLabel="Weights" ChartAreaName="BarChart">
                        <Telerik:SeriesMapping.SeriesDefinition>
                            <Telerik:BarSeriesDefinition LegendDisplayMode="None"
                                                     ItemStyle="{StaticResource BarStyle}"
                                                     SeriesItemLabelStyle="{StaticResource LabelStyle}"/>
                        </Telerik:SeriesMapping.SeriesDefinition>
                        <Telerik:SeriesMapping.ItemMappings>
                            <Telerik:ItemMapping FieldName="Weight" DataPointMember="YValue"/>
                            <Telerik:ItemMapping FieldName="InstanceNumber" DataPointMember="XCategory"/>
                        </Telerik:SeriesMapping.ItemMappings>
                    </Telerik:SeriesMapping>
                </Telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
            </Telerik:ChartHierarchicalViewDescriptor>
            <Telerik:ChartHierarchicalViewDescriptor>
                <Telerik:ChartHierarchicalViewDescriptor.Relation>
                    <Telerik:PropertyRelation ParentPropertyName="Children"/>
                </Telerik:ChartHierarchicalViewDescriptor.Relation>
                <Telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
                    <Telerik:SeriesMapping LegendLabel="Weights" ChartArea="BarChart">
                        <Telerik:SeriesMapping.SeriesDefinition>
                            <Telerik:BarSeriesDefinition LegendDisplayMode="None" />
                        </Telerik:SeriesMapping.SeriesDefinition>
                        <Telerik:SeriesMapping.ItemMappings>
                            <Telerik:ItemMapping FieldName="Weight" DataPointMember="YValue"/>
                            <Telerik:ItemMapping FieldName="InstanceNumber" DataPointMember="XCategory"/>
                        </Telerik:SeriesMapping.ItemMappings>
                    </Telerik:SeriesMapping>
                </Telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
            </Telerik:ChartHierarchicalViewDescriptor>
        </Telerik:RadChart.HierarchicalViewDescriptors>
    </Telerik:RadChart>

    As you can see, I'm getting a mystery series in the center of my grid. How do I get rid of it? I'm having a lot of trouble setting up these charts.
  2. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 12 Nov 2011 Link to this post

    Hello Eric,

    This issue is more likely to appear if you don't use the DefaultView of the Chart.
    You should set the corresponding ChartArea's Name to the SeriesMapping.ChartAreaName property.
    If this doesn't help I would suggest that you send us your runnable project so that we will be able to investigate it locally and get back to you with our findings/suggestions based on the code.

    Best wishes,
    Evgenia
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top