Jump to content
Software FX Community

Legend box as tooltip or autohidden


beltrams

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...