multiple-series-types combine with Rangebar and LineSeries

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

    Posted 06 Apr 2016 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 Ivanov
    Martin Ivanov avatar
    1475 posts

    Posted 08 Apr 2016 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">
            <Style TargetType="telerik:RangeSeries">
                <Setter Property="CategoryBinding" Value="MyCategory"/>
                <Setter Property="HighBinding" Value="MyHighValue"/>
                <Setter Property="LowBinding" Value="MyLowValue"/>                                   
    You can use this descriptor for all chart series.

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top