4 Answers, 1 is accepted
This is my current code.
01.<telerikChart:RadPieChart x:Name="Chart1">02. <telerikChart:RadPieChart.BindingContext>03. <local:ViewModel />04. </telerikChart:RadPieChart.BindingContext>05. <telerikChart:RadPieChart.Series>06. <telerikChart:DonutSeries InnerRadiusFactor="0.8" ShowLabels="false"07. ValueBinding="Value"08. LabelBinding="Category"09. LegendTitleBinding="Name"10. ItemsSource="{Binding Data}" />11. </telerikChart:RadPieChart.Series>12. <telerikChart:RadPieChart.Palette>13. <telerikChart:ChartPalette>14. <telerikChart:ChartPalette.Entries>15. <telerikChart:PaletteEntry FillColor="DarkBlue" StrokeColor="DarkBlue" />16. <telerikChart:PaletteEntry FillColor="LightBlue" StrokeColor="LightBlue" />17. </telerikChart:ChartPalette.Entries>18. </telerikChart:ChartPalette>19. </telerikChart:RadPieChart.Palette>20. <telerikChart:RadPieChart.ChartBehaviors>21. <telerikChart:ChartTooltipBehavior TriggerMode="Tap" />22. </telerikChart:RadPieChart.ChartBehaviors>23. </telerikChart:RadPieChart>24. <telerikChart:RadLegend LegendProvider="{x:Reference Name=Chart1}" />When user tap on a slice, the colour got changed. how do i prevent this?
Also, can i also check how do i show the tooltip when user tap on a slice.
Hello Benjamin,
Thank you for sending the snippet you're using.
Creating a ChartPalette is the proper way to customize the slices' colors - you just need to add a few more entries to cover all the data items. The legend follows the same palette set to the Chart.
As to the selection of slices - you can prevent it by setting AllowSelect property of the DonutSeries to False.
I have attached a sample XAML page based on the provided snippet to show you how this would work - please download it and give it a try.
Lastly, about the tootips - currently the ToolTipBehavior does not work properly for PieChart, we have this logged as a bug report in our feedback portal, you can track its status at the link below:
https://feedback.telerik.com/xamarin/1366403-piechart-tooltip-behavior-is-not-working-properly
Let me know if I can help with anything else.
Regards,
Yana
Progress Telerik
Hi Yana
Thanks for your reply. In the meantime, is there any workaround for the tooltip issue? as it is a very important function for my app
Hi Benjamin,
We've previously researched this issue, so I can immediately reply - there isn't a feasible workaround I could suggest at the moment. It's quite a complicated issue in the native Chart controls and we're having it in mind, still, I cannot commit to any timeframe for providing a fix. We will update the feedback item as soon as there is any progress on it.
Regards,
Yana
Progress Telerik