beltrams Posted March 11, 2011 Report Posted March 11, 2011 Dear Forum, Is it possible to have a placeholder instead of the legend box and a tooltip showing what generally is in the legendbox? Or have a legendbox that autohide if the mouse is not over the placeholder? If there is a XAML solution only it would be great... Many thanks. Quote
JuanC Posted March 11, 2011 Report Posted March 11, 2011 The following XAML shows how to change the style of the legend box <cfx:Chart Gallery="Bar"> <cfx:Chart.LegendBox> <cfx:LegendBox ContainerStyle="{StaticResource tooltipLegend}" /> </cfx:Chart.LegendBox></cfx:Chart> The following 2 styles will display a collapsible legend box as well as a placeholder (red rectangle) showing the legendbox as a tooltip. <Style x:Key="collapsibleLegend" TargetType="{x:Type ItemsControl}"> <Style.Setters> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ItemsControl}"> <Expander x:Name="expLegend" Header="Legend Box"> <ItemsPresenter /> </Expander> </ControlTemplate> </Setter.Value> </Setter> </Style.Setters></Style><Style x:Key="tooltipLegend" TargetType="{x:Type ItemsControl}"> <Style.Setters> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ItemsControl}"> <Rectangle Width="16" Height="16" Fill="Red" Stroke="Black"> <Rectangle.ToolTip> <ItemsPresenter /> </Rectangle.ToolTip> </Rectangle> </ControlTemplate> </Setter.Value> </Setter> </Style.Setters></Style> JuanC Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.