Series Mapping

2 posts, 0 answers
  1. Student
    Student avatar
    3 posts
    Member since:
    Feb 2013

    Posted 22 Feb 2013 Link to this post

    Hi, 

    I am trying to display company revenue by product using AreaSeries and SeriesMapping. But unfortunately
    I don't know how to set CombineMode in SeriesMapping way. Could you please provide an example? 

    private
    void SetMappings(RadChart chart)
    {
        SeriesMapping seriesMapping = new SeriesMapping() { ChartAreaName = "MyChartArea" };
        seriesMapping.SeriesDefinition = new AreaSeriesDefinition();
     
        //=============================================//
        ItemMapping itemMapping = new ItemMapping();
        itemMapping.DataPointMember = DataPointMember.YValue;
        itemMapping.FieldName = "Rev";
     
        ItemMapping itemMapping2 = new ItemMapping();
        itemMapping2.DataPointMember = DataPointMember.XValue;
        itemMapping2.FieldName = "Date";
     
        seriesMapping.ItemMappings.Add(itemMapping);
        seriesMapping.ItemMappings.Add(itemMapping2);
     
        chart.SeriesMappings.Add(seriesMapping);
    }

    <telerikChart:RadChart x:Name="RadChart1" UseDefaultLayout="False">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
     
                <telerikCharting:ChartTitle Grid.ColumnSpan="2" Content="Chart Title"></telerikCharting:ChartTitle>
     
                <telerikCharting:ChartArea Grid.Row="1" x:Name="MyChartArea" LegendName="MyLegend" Margin="-1,1,1,-1"  />
                <telerikCharting:ChartLegend Grid.Row="1" Grid.Column="1" x:Name="MyLegend"></telerikCharting:ChartLegend>
            </Grid>
        </telerikChart:RadChart>


    Thanks!
  2. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 27 Feb 2013 Link to this post

    Hi,

     From your code snippets I assume that you are using our RadChart control. There is no property CombineMode in RadChart. Instead , you should create StackedArea (Stacked100Area) series definition(s). This is demonstrated in our demo with source code provided.
    CombineMode is property of RadChartView control and is demonstrated here.

    Regards,
    Evgenia
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top