Value cannot be null. Parameter name: format when using SeriesDescriptor and Legend

2 posts, 0 answers
  1. StepTNT
    StepTNT avatar
    18 posts
    Member since:
    Mar 2013

    Posted 11 Jun 2015 Link to this post

    Quick code snippet:

     

    1.public class Data
    2.    {
    3.        public int XValue{ get; set; }
    4. 
    5.        public double YValue { get; set; }
    6. 
    7.        public string Network { get; set; }
    8.    }
     

     

    01.<telerikPrimitives:RadLegendControl LegendProvider="{Binding ElementName=chart}"                                           
    02.                                            x:Name="legend"
    03.                                            Grid.Row="0"                                             
    04.                                            >
    05.            <telerikPrimitives:RadLegendControl.ItemsPanel>
    06.                <ItemsPanelTemplate>
    07.                    <StackPanel Orientation="Horizontal"/>
    08.                </ItemsPanelTemplate>
    09.            </telerikPrimitives:RadLegendControl.ItemsPanel>
    10.        </telerikPrimitives:RadLegendControl>
    11.        <telerikChart:RadCartesianChart x:Name="chart"
    12.                                        PaletteName="DefaultLight"
    13.                                        Grid.Row="1">
    14.            <telerikChart:RadCartesianChart.VerticalAxis>
    15.                <telerikChart:LinearAxis Maximum="100"
    16.                                         Minimum="0"
    17.                                         />
    18.            </telerikChart:RadCartesianChart.VerticalAxis>
    19.            <telerikChart:RadCartesianChart.HorizontalAxis>
    20.                <telerikChart:LinearAxis
    21.                                         RangeExtendDirection="Both"
    22.                                         LastLabelVisibility="Hidden"/>
    23.            </telerikChart:RadCartesianChart.HorizontalAxis>
    24.             
    25.            <telerikChart:RadCartesianChart.SeriesProvider>
    26.                <telerikChart:ChartSeriesProvider x:Name="provider">                   
    27.                    <telerikChart:ChartSeriesProvider.SeriesDescriptors>
    28.                        <telerikChart:ScatterSeriesDescriptor XValuePath="XValue"
    29.                                                              YValuePath="YValue"                                                             
    30.                                                              LegendTitlePath="Label">                           
    31.                            <telerikChart:ScatterSeriesDescriptor.Style>
    32.                                <Style TargetType="telerikChart:ScatterSplineAreaSeries">
    33.                                    <Setter Property="ShowLabels" Value="True"/>                                   
    34.                                    <Setter Property="IsVisibleInLegend" Value="True"/>
    35.                                    <Setter Property="Fill" Value="white"/>
    36.                                    <Setter Property="CompositeMode" Value="MinBlend"/>                                                                        
    37.                                    <Setter Property="StrokeThickness" Value="2"/>
    38.                                    <Setter Property="Opacity" Value="0.7"/>
    39.                                    <Setter Property="StrokeLineJoin" Value="Round"/>                                    
    40.                                </Style>
    41.                            </telerikChart:ScatterSeriesDescriptor.Style>                             
    42.                        </telerikChart:ScatterSeriesDescriptor>
    43.                    </telerikChart:ChartSeriesProvider.SeriesDescriptors>                   
    44.                </telerikChart:ChartSeriesProvider>
    45.            </telerikChart:RadCartesianChart.SeriesProvider>         
    46.        </telerikChart:RadCartesianChart>

  2. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 15 Jun 2015 Link to this post

    Hi Stafeno,

    Thank you for sending this code snippet. Based on it I have built sample project demonstrating how to setup chart and its legend. Please have a look at the attachment and let us know if this helps. If the setup does not represent the scenario specifics, could you modify it and send it back to us.

    Regards,
    Tsvyatko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top