This is a migrated thread and some comments may be shown as answers.
Crash of RadCartesianChart only on Xamarin.IOS
5 Answers 26 Views
This is a migrated thread and some comments may be shown as answers.
Paola
Top achievements
Rank 1
Paola asked on 15 Jan 2018, 05:43 PM

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.

5 Answers, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 17 Jan 2018, 12:16 AM
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
0
Paola
Top achievements
Rank 1
answered on 17 Jan 2018, 11:42 AM
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.
0
Lance | Manager Technical Support
Telerik team
answered on 17 Jan 2018, 06:14 PM
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
0
Lance | Manager Technical Support
Telerik team
answered on 17 Jan 2018, 06:40 PM
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
0
Paola
Top achievements
Rank 1
answered on 18 Jan 2018, 05:45 PM
Hello Lance thank you for yout reply.

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

Tags
Chart
Asked by
Paola
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Paola
Top achievements
Rank 1
Share this question
or