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

display title/header beginning of each stepline of cartesianchart

3 Answers 16 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Sivakumar
Top achievements
Rank 1
Sivakumar asked on 10 Mar 2016, 07:24 AM
 
I Would like to bind title/header beginning of each line of chart from data source.I already binded with required display with legend and it is working fine but i need help to display at beginging of each line series.Please help it..please refer image...
 
<telerik:RadCartesianChart.SeriesProvider>               
             <telerik:ChartSeriesProvider Source="{Binding Data}">                   
                 <telerik:ChartSeriesProvider.SeriesDescriptors>
                     <telerik:CategoricalSeriesDescriptor  ItemsSourcePath="LineData" ValuePath="Value" CategoryPath="Vector" >
                         <telerik:CategoricalSeriesDescriptor.Style>
                             <Style TargetType="telerik:StepLineSeries">
                                 <Setter Property="StrokeThickness" Value="2"/>
                                 <Setter Property="ShowLabels" Value="False"/>
                                 <Setter Property="PointTemplate" Value="{StaticResource LinePointTemplate}"/>
                                 <Setter Property="LegendSettings">
                                     <Setter.Value>
                                         <telerik:SeriesLegendSettings  x:Name="l" Title="{Binding Name}"/>
                                     </Setter.Value>
                                 </Setter>
                                 <Setter Property="VerticalAxis">
                                     <Setter.Value>
                                         <telerik:LinearAxis Title="{Binding Name}" LabelTemplate="{StaticResource YLabelTemplate}"   
                                   />
                                     </Setter.Value>
                                 </Setter>
                             </Style>
                          
                         </telerik:CategoricalSeriesDescriptor.Style>
                     </telerik:CategoricalSeriesDescriptor>
                 </telerik:ChartSeriesProvider.SeriesDescriptors>                   
             </telerik:ChartSeriesProvider>
         </telerik:RadCartesianChart.SeriesProvider>

 

VM .. { ..
public ObservableCollection<Item> Data { get; set; }
 
 Data.Add(new WaveFormItem()
            {
                Name = "105.1",
                LineData = new ObservableCollection<LineDataModel>()
            {
                new WaveFormLineData() { Vector = 0, Value = 1.0 },
                new WaveFormLineData() { Vector = 1, Value = 1.1 }
             }
             });
 
}
 
 public class LineDataModel
    {
        public int Vector { get; set; }
        public double Value { get; set; }
    }
 
    public class Item
    {
        public string Name { get; set; }
        public ObservableCollection<LineDataModel> LineData { get; set; }
    }

3 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 10 Mar 2016, 08:40 AM
Hello Sivakumar,

I think that the best way to go here is to use a custom annotation. You can set its horizontal and vertical values to be the first item's category and value. You can check our online qsf examples and our sdk samples too.

Regards,
Petar Marchev
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Sivakumar
Top achievements
Rank 1
answered on 10 Mar 2016, 09:35 AM
Thanks..Is it possible to provide some sample here ? ..I need to display title for each line of chart...
0
Petar Marchev
Telerik team
answered on 10 Mar 2016, 02:27 PM
Hello,

Adding annotations is very simple and you can use these references to see how:
online examples
sdk repository
online documentation

Regards,
Petar Marchev
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
Petar Marchev
Telerik team
Sivakumar
Top achievements
Rank 1
Share this question
or