display title/header beginning of each stepline of cartesianchart

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

    Posted 10 Mar Link to this post

     
    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; }
        }
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 10 Mar Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sivakumar
    Sivakumar avatar
    27 posts
    Member since:
    Dec 2015

    Posted 10 Mar in reply to Petar Marchev Link to this post

    Thanks..Is it possible to provide some sample here ? ..I need to display title for each line of chart...
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 10 Mar Link to this post

    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.
Back to Top