Telerik SplineSeries wrong display value

2 posts, 0 answers
  1. Hai
    Hai avatar
    1 posts
    Member since:
    Jan 2016

    Posted 03 Jan Link to this post

    Hi Telerik,

    I've installed Telerik RadCartersianChart as following code:

     

    <telerik:RadCartesianChart x:Name="GrowthChart"
                                                   Background="White"
                                                   EmptyContent="Loading data "
     
                                                   MaxZoom="2,2"
                                                   FontSize="8" Foreground="#FFF7B11A" Grid.Row="1"
                                                   FontFamily="ms-appx:/Fonts/segoeuil.ttf#Segoe UI Light">
                            <telerik:RadCartesianChart.Resources>
                                <Style x:Key="CustomAxisLineStyle" TargetType="Line">
                                    <Setter Property="Stroke" Value="{ThemeResource PhoneAccentBrush}" />
                                    <Setter Property="StrokeThickness" Value="1" />
                                </Style>
                                <Style TargetType="Line" x:Key="StripLinesStyle">
                                    <Setter Property="Stroke" Value="DimGray" />
                                    <Setter Property="StrokeThickness" Value="1" />
                                    <Setter Property="Opacity" Value="0.1" />
                                </Style>
     
                            </telerik:RadCartesianChart.Resources>
     
     
                            <telerik:RadCartesianChart.Grid>
                                <telerik:CartesianChartGrid MajorLinesVisibility="XY"
                                                            MajorYLineStyle="{StaticResource StripLinesStyle}"
                                                            MajorXLineStyle="{StaticResource StripLinesStyle}" />
                            </telerik:RadCartesianChart.Grid>
     
     
                            <telerik:RadCartesianChart.HorizontalAxis>
                                <telerik:CategoricalAxis LineStyle="{StaticResource CustomAxisLineStyle}"
                                                         Foreground="{ThemeResource PhoneAccentBrush}" FontSize="9" />
                            </telerik:RadCartesianChart.HorizontalAxis>
     
     
                            <telerik:RadCartesianChart.VerticalAxis>
                                <telerik:LinearAxis LineStyle="{StaticResource CustomAxisLineStyle}"
                                                    Foreground="{ThemeResource PhoneAccentBrush}" FontSize="9" />
                            </telerik:RadCartesianChart.VerticalAxis>
     
     
                            <telerik:SplineSeries x:Name="Line5th"
                                                  ValueBinding="{StaticResource ValueBinding}"
                                                  CategoryBinding="{StaticResource CategoryBinding}"
                                                  StrokeThickness="1"
                                                  CombineMode="Stack" Stroke="#FFA0CAE2" />
     
                            
     
                        </telerik:RadCartesianChart>

     

    And code Behind:

     

    1.Line5th.ItemsSource = await ChartGalleryModel.GetWhoCategoricalData(1, 5);

    It displayed and worked perfectly as the first picture attach.

    But I want more line. I added more Spline Line as example code:

     

    01.<telerik:SplineSeries x:Name="Line5th"
    02.                                              ValueBinding="{StaticResource ValueBinding}"
    03.                                              CategoryBinding="{StaticResource CategoryBinding}"
    04.                                              StrokeThickness="1"
    05.                                              CombineMode="Stack" Stroke="#FFA0CAE2" />
    06. 
    07.                        <telerik:SplineSeries x:Name="Line10th"
    08.                                              ValueBinding="{StaticResource ValueBinding}"
    09.                                              CategoryBinding="{StaticResource CategoryBinding}"
    10.                                              StrokeThickness="1"
    11.                                              CombineMode="Stack" Stroke="#FFA0CAE2" />
    12. 
    13. 
    14.                        <telerik:SplineSeries x:Name="Line25th"
    15.                                              ValueBinding="{StaticResource ValueBinding}"
    16.                                              CategoryBinding="{StaticResource CategoryBinding}"
    17.                                              StrokeThickness="1"
    18.                                              CombineMode="Stack" Stroke="#FFA0CAE2" />

    And edit the code behind:

          Line5th.ItemsSource = await ChartGalleryModel.GetWhoCategoricalData(1, 5);
          Line10th.ItemsSource = await ChartGalleryModel.GetWhoCategoricalData(1, 10);
          Line25th.ItemsSource = await ChartGalleryModel.GetWhoCategoricalData(1, 25);

    All line displayed perfectly as i want they are. But there is a small problem with the data value (see 2nd image).

    All my data has no value larger than 20, but as I saw in chart, they larger than real value, why ?

    Thank you

  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 07 Jan Link to this post

    Hi Hai,

    Can you please show us the code for the ChartGalleryModel.GetWhoCategoricalData method? Thanks.

    Best regards,
    Ves
    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