multiple-series-types combine with Rangebar and LineSeries

2 posts, 1 answers
  1. Sivakumar
    Sivakumar avatar
    27 posts
    Member since:
    Dec 2015

    Posted 06 Apr Link to this post

    I am working on multiple-series-types-with-chartseriesprovider-and-typepath , I am using RangeBarSeries and lineseries Type. i am getting compile error as below.Please advice the right approach to add mixed series.

    Additional information: Unable to cast object of type 'Telerik.Windows.Controls.ChartView.RangeBarSeries' to type 'Telerik.Windows.Controls.ChartView.CategoricalSeries'.
  2. Answer
    Martin
    Admin
    Martin avatar
    1099 posts

    Posted 08 Apr Link to this post

    Hello Sivakumar,

    The error appears because the CategoricalSeriesDescriptor doesn't support RangeSeries. Instead, you can use the base ChartCategoricalDescriptor.
    <telerik:ChartSeriesDescriptor ItemsSourcePath="MyDataPointsCollection">
        <telerik:ChartSeriesDescriptor.Style>
            <Style TargetType="telerik:RangeSeries">
                <Setter Property="CategoryBinding" Value="MyCategory"/>
                <Setter Property="HighBinding" Value="MyHighValue"/>
                <Setter Property="LowBinding" Value="MyLowValue"/>                                   
            </Style>
        </telerik:ChartSeriesDescriptor.Style>
    </telerik:ChartSeriesDescriptor>
    You can use this descriptor for all chart series.

    Regards,
    Martin
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top