bskidan Posted December 7, 2009 Report Share Posted December 7, 2009 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. Quote Link to comment Share on other sites More sharing options...
JuanC Posted December 8, 2009 Report Share Posted December 8, 2009 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 Quote Link to comment Share on other sites More sharing options...
bskidan Posted December 8, 2009 Author Report Share Posted December 8, 2009 Thank you, Juan. This works great - exactly what I was looking for. Quote Link to comment Share on other sites More sharing options...
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.