Crash of RadCartesianChart only on Xamarin.IOS

6 posts, 0 answers
  1. Paola
    Paola avatar
    3 posts
    Member since:
    Dec 2016

    Posted 15 Jan 2018 Link to this post

    Hello, I have an issue on Xamarin.IOS for RadCartesianChart that I can't solve.

    This is my chart on in xaml:

    <telerikChart:RadCartesianChart x:Name="rad"   >

                            <telerikChart:RadCartesianChart.Behaviors>
                                <telerikChart:ChartSelectionBehavior DataPointSelectionMode="Single"  />
                            </telerikChart:RadCartesianChart.Behaviors >

                              <telerikChart:RadCartesianChart.HorizontalAxis  >
                                <telerikChart:CategoricalAxis LineColor="#000" LabelFontSize="10" LabelFitMode="MultiLine" />
                            </telerikChart:RadCartesianChart.HorizontalAxis>

     
                            <telerikChart:RadCartesianChart.VerticalAxis >
                                <telerikChart:NumericalAxis LineColor="#000" />
                            </telerikChart:RadCartesianChart.VerticalAxis>
                            <telerikChart:RadCartesianChart.Series    >
                                <telerikChart:BarSeries  ItemsSource="{Binding DBSoldercolorsFirst}" CombineMode="Stack" CategoryBinding="CPE_NomeColore" ValueBinding="CPE_Nerogazioni"  >
                                    <telerikChart:BarSeries.ValueBinding >
                                        <telerikChart:PropertyNameDataPointBinding PropertyName="CPE_Nerogazioni" />
                                    </telerikChart:BarSeries.ValueBinding>
                                    <telerikChart:BarSeries.CategoryBinding>
                                        <telerikChart:PropertyNameDataPointBinding PropertyName="CPE_NomeColore" />
                                    </telerikChart:BarSeries.CategoryBinding>
                                    <!--  <telerikChart:BarSeries.DefaultVisualStyle >
                                        <Style TargetType="telerikChart:BarSeries">
                                            <Setter Property="BackgroundColor" Value="#000"/>
                                        </Style>
                                    </telerikChart:BarSeries.DefaultVisualStyle> -->
                                </telerikChart:BarSeries >
                                <telerikChart:BarSeries ItemsSource="{Binding DBSoldercolorsSecond}" CombineMode="Stack" ShowLabels="True" >
                                    <telerikChart:BarSeries.ValueBinding >
                                        <telerikChart:PropertyNameDataPointBinding PropertyName="CPE_Nerogazioni" />
                                    </telerikChart:BarSeries.ValueBinding>
                                    <telerikChart:BarSeries.CategoryBinding>
                                        <telerikChart:PropertyNameDataPointBinding PropertyName="CPE_NomeColore"/>
                                    </telerikChart:BarSeries.CategoryBinding>
                                </telerikChart:BarSeries >
                                <telerikChart:BarSeries ItemsSource="{Binding DBSoldercolorsThird}" CombineMode="Stack"  ShowLabels="True" >
                                    <telerikChart:BarSeries.ValueBinding>
                                        <telerikChart:PropertyNameDataPointBinding PropertyName="CPE_Nerogazioni"  />
                                    </telerikChart:BarSeries.ValueBinding>
                                    <telerikChart:BarSeries.CategoryBinding>
                                        <telerikChart:PropertyNameDataPointBinding PropertyName="CPE_NomeColore"/>
                                    </telerikChart:BarSeries.CategoryBinding>
                                </telerikChart:BarSeries>
                            </telerikChart:RadCartesianChart.Series>
                        </telerikChart:RadCartesianChart>

    In Android and UWP it work well, but on IOS it crash on page's chart lunch.

    If I'll remove the RadCartesianChart.HorizontalAxis tag the page will load withouth crash.
    The data value of the binding seems to be correct.

    I hope someone can help me. Thank you in advance.

  2. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1195 posts

    Posted 16 Jan 2018 Link to this post

    Hi Paola,

    Try using a full HEX code for the LineColor, or use one of the enum values:

    FULL RGB HEX CODE FOR BLACK
    <telerikChart:RadCartesianChart.HorizontalAxis  >
        <telerikChart:CategoricalAxis LineColor="#000000" LabelFontSize="10" LabelFitMode="MultiLine" />
    </telerikChart:RadCartesianChart.HorizontalAxis>
     
    ENUM
    <telerikChart:RadCartesianChart.HorizontalAxis  >
        <telerikChart:CategoricalAxis LineColor="Black" LabelFontSize="10" LabelFitMode="MultiLine" />
    </telerikChart:RadCartesianChart.HorizontalAxis>

    Regards,
    Lance | Tech Support Engineer, Sr.
    Progress 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
  3. Paola
    Paola avatar
    3 posts
    Member since:
    Dec 2016

    Posted 17 Jan 2018 in reply to Lance | Manager Technical Support Link to this post

    Hi Lance, thanks for your reply.

    I tried your suggestion but it didn't work.

    I have other telerik control on same page: a RadPieChart and a RadListView.
    These controls also have a color declaration that is the same as the one I use in RadCartesianChart and they work fine.

    Thanks in advance for any other suggestions.
  4. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1195 posts

    Posted 17 Jan 2018 Link to this post

    Hello Paola,

    I reviewed your code again and noticed that you're setting the CategoryBinding and ValueBinding twice for the first BarSeries.

    Syntax Correction

    Remove the incorrect Category and Value bindings:




    Reproducible

    I am building out a demo around your code to investigate this further. I will have to make up some of the data and bound objects.

    If my syntax correction above doesn't resolve the problem, please reply back with the view model and data model classes so I can more accurately represent your scenario in my demo.

    Regards,
    Lance | Tech Support Engineer, Sr.
    Progress 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
  5. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1195 posts

    Posted 17 Jan 2018 Link to this post

    Hello Paolo,

    I've completed my investigation and have attached a demo app I build using your chart code after making corrections to the invalid XAML.

     Find the demo attached, here is the result at run-time:



    Wrapping Up

    I recommend enabling the XAML Compilation (aka XamlC) feature of Xamarin.Forms. You will experience build errors, instead of run-time errors, when there is invalid XAML. 

    If you have any further trouble, please open a support ticket here and attach all the relevant code, or update my demo so that it replicates the issue. With this, we can investigate further.

    Regards,
    Lance | Tech Support Engineer, Sr.
    Progress 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
  6. Paola
    Paola avatar
    3 posts
    Member since:
    Dec 2016

    Posted 18 Jan 2018 in reply to Lance | Manager Technical Support Link to this post

    Hello Lance thank you for yout reply.

    Now i'm able to compile and run my project, thanks for your time!

Back to Top