Jump to content
Software FX Community

ToolTip gets style-defined frame around my template


bskidan
 Share

Recommended Posts

I'm trying to format series ToolTip using my own DataTemplate. The tooltip is formated correctly, but it is displayed within another element (ToolTip I guess) that I can't find a way to get rid of. The element is formatted based on the style that the chart uses (Basic in my case - light yellow rectangle). All I need is a rounded rectangle using my application colors. Xaml below:

<cfx:Chart Name="_dataChart" Style="{x:Static cfxmotifs:Basic.Style}" DataBound="_dataChart_DataBound">   <cfx:Chart.Series> <cfx:SeriesAttributes BindingPath="SeriesA" Content="Series A" Gallery="Area">   <cfx:SeriesAttributes.ToolTips>   <cfx:ToolTipAttributes ConnectedStyle="Closest">   <cfx:ToolTipAttributes.Template>   <DataTemplate>   <Grid DataContext="{Binding Path=DataItem}">   <Border Background="Black" BorderThickness="1" CornerRadius="5" Padding="5">   <StackPanel>   <TextBlock Text="{Binding Timestamp, StringFormat=d}" Foreground="LimeGreen"/>   <TextBlock Text="{Binding SeriesA, StringFormat=#}" Foreground="Red"/>   </StackPanel>   </Border>   </Grid>   </DataTemplate>   </cfx:ToolTipAttributes.Template>   </cfx:ToolTipAttributes>   </cfx:SeriesAttributes.ToolTips>   </cfx:SeriesAttributes>   </cfx:Chart.Series>   <cfx:Chart.AxisX>   <cfx:Axis>   <cfx:Axis.Labels>   <cfx:AxisLabelAttributes BindingPath="Timestamp" CustomFormat="MM-dd-yy"/>   </cfx:Axis.Labels>   </cfx:Axis>   </cfx:Chart.AxisX></cfx:Chart>

Thank you.

post-5001-13922412921171_thumb.jpg

Link to comment
Share on other sites

To control the frame/chrome of the tooltip you should remove the Black Rounded border from the DataTemplate and add the following XAML

  <cfx:Chart.ToolTipArea>

  <cfx:ToolTipArea>

  <cfx:ToolTipArea.Template>

  <ControlTemplate TargetType="{x:Type cfx:ToolTipArea}">

  <Border Background="Black" BorderThickness="1" CornerRadius="5" Padding="5">

  <ContentPresenter/>

  </Border>

  </ControlTemplate>

  </cfx:ToolTipArea.Template>

  </cfx:ToolTipArea>

  </cfx:Chart.ToolTipArea>

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.

 Share

×
×
  • Create New...