Page 1 of 1

How to create scrollbar for legend box in WPF

Posted: Fri Sep 28, 2018 12:43 am
by parks95
Hello,

I need to create vertical scroll bar for legend box in WPF because I have a lot of legends.

I did with folliowing code but scroll bar was not created.

<lcub:LegendBoxXYCollection>
<lcub:LegendBoxXY Visible="True" ShowCheckboxes="True" Position="SegmentRightMarginCenter"
Layout="Vertical" AutoSize="True" ScrollBarVisibility="Vertical"
MouseHighlight="None" MouseInteraction="True" AllowMouseResize="False" MoveByMouse="False"
HighlightSeriesOnTitle="False" SeriesTitleColor="Gray" HighlightSeriesTitleColor="Black"
CheckBoxColor="Gray" CheckMarkColor="Gray" >
<lcub:LegendBoxXY.Fill>
<lcub:Fill Color="Transparent" GradientColor="Transparent"/>
</lcub:LegendBoxXY.Fill>
<lcub:LegendBoxXY.Shadow>
<lcub:Shadow Visible="False"/>
</lcub:LegendBoxXY.Shadow>
</lcub:LegendBoxXY>
</lcub:LegendBoxXYCollection>

Please give me the method to solve this problem.

Thank you,
Liam

Re: How to create scrollbar for legend box in WPF

Posted: Fri Sep 28, 2018 7:01 am
by ArctionKestutis
Hello,
You should disable AutoSize property and modify Height according to your needs. Otherwise LegendBox is always automatically sized.