BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi !
I create a PieSeries Chart with a ChartLegend.
There are a lot of Items in the ChartLegend.
How can i make the ChartLegend scrollable, if the items not fit in the WrapGrid?
Fixed PieSeries Chart and scrollable ChartLegend?
Thanks
Hi Christof,
Thanks for using Syncfusion products.
We have analyzed the reported query. You can achieve your requirement by applying the below code snippet.
Code snippet [XAML]:
Legend ItemsPanel:
<Charts:ChartLegend.ItemsPanel>
<ItemsPanelTemplate>
<VariableSizedWrapGrid Orientation='Horizontal' MaximumRowsOrColumns='5'/>
</ItemsPanelTemplate>
</Charts:ChartLegend.ItemsPanel>
</Charts:ChartLegend>
We have prepared the sample based on this and this can be downloaded from the following location.
Please let us know if you require any further assistance on this.
Regards,
Karthikeyan V.
Thanks for the fast response.
But this is not the solution for my problem.
I have only a small size for the Legend and ItemsPanel should be scrollable if the Panel not fit.
Your example with the VariableSizedWrapGrid grow endless.
Thanks
Hi Christof,
Thanks for the update.
You can achieve your requirement with help the ScrollViewer can be enabled for ChartLegend by overriding its ControlTemplate as in below code snippets.
Code snippet [XAML]:
<Charts:ChartLegend.Template>
<ControlTemplate>
<ScrollViewer HorizontalScrollBarVisibility="Visible" >
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</Charts:ChartLegend.Template>
We have prepared a sample based on this. please download the sample under the following location.
Please let us know if you require further assistance on this.
Thanks,
Karthikeyan V.
Thanks for help! :-)