We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ChartLegend Wrap Grid

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



4 Replies

KV Karthikeyan V Syncfusion Team March 20, 2014 07:29 AM UTC

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.


Attachment: ChartLegendWithWrapPanel_c9b8abdf.zip


PS Pseudocode March 20, 2014 08:51 AM UTC

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



KV Karthikeyan V Syncfusion Team March 21, 2014 04:17 AM UTC

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.


Attachment: ChartLegendWithScrollViewer_2a2d44a.zip


PS Pseudocode March 21, 2014 09:33 AM UTC

Thanks for help! :-)


Loader.
Live Chat Icon For mobile
Up arrow icon