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

multiple-series-types combine with Rangebar and LineSeries

1 Answer 37 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Sivakumar
Top achievements
Rank 1
Sivakumar asked on 06 Apr 2016, 10:05 AM
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'.

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 08 Apr 2016, 11:21 AM
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.
Tags
ChartView
Asked by
Sivakumar
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or