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

SeriesProvider not working for Derived BarSeries TargetType

1 Answer 65 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
N
Top achievements
Rank 1
N asked on 22 May 2014, 06:43 PM
We are getting Ui Automation related error using ScatterLineSeries and BarSeries..
So I tried to create a class derived from BarSeries
public class CustomLineSeries : LineSeries
{
       protected override AutomationPeer OnCreateAutomationPeer()
       {    return null;   }
}
The issue is I cannot seem to get the series plotted when using derived BarSeries when I use the below code...
Issue seems to be with the Style tageting CustomBarSeries... Removing this style I can see the BarSeries in chart.
But the question is HOW do i set the Style of the derived BarSeries Class...

<telerik:RadCartesianChart.SeriesProvider>
<telerik:ChartSeriesProvider Source="{Binding Series}">
   <telerik:ChartSeriesProvider.SeriesDescriptors>
       <telerik:CategoricalSeriesDescriptor ItemsSourcePath="ChartsDataPoints" CategoryPath="X" ValuePath="Y" TypePath="SeriesType">
           <telerik:CategoricalSeriesDescriptor.Style>
               <Style TargetType="charts:CustomBarSeries">
                    <Setter Property="CombineMode" Value="None"/>
                    <Setter Property="DisplayName" Value="{Binding LegendTitle}"/>
               </Style>
           </telerik:CategoricalSeriesDescriptor.Style>
         </telerik:CategoricalSeriesDescriptor>
     </telerik:ChartSeriesProvider.SeriesDescriptors>
</telerik:ChartSeriesProvider>

In code behind I had Set SeriesType as typeof(CustomBarSeries)....

Have been breaking my head on this... any help is appreciated..

1 Answer, 1 is accepted

Sort by
0
N
Top achievements
Rank 1
answered on 22 May 2014, 09:09 PM
Please ignore, I missed something. It is working now after i made some xaml changes..
Tags
ChartView
Asked by
N
Top achievements
Rank 1
Answers by
N
Top achievements
Rank 1
Share this question
or