Is there a way to change the "Text" property of the tooltip modifier, using C#?
I want to change these labels:
I'm using "WaterfallRenderableSeries3D".
My Code:
<s3D:SciChart3DSurface x:Name="SciChartView1"
Height="850" Width="1400"
Margin="50,100,50,0" HorizontalAlignment="Left" VerticalAlignment="Top">
<s3D:SciChart3DSurface.RenderableSeries>
<s3D:WaterfallRenderableSeries3D x:Name="WaterfallSeriesView1" Style="{StaticResource WaterfallSeriesStyle}"/>
</s3D:SciChart3DSurface.RenderableSeries>
<s3D:SciChart3DSurface.XAxis>
<s3D:NumericAxis3D/>
</s3D:SciChart3DSurface.XAxis>
<s3D:SciChart3DSurface.YAxis>
<s3D:NumericAxis3D/>
</s3D:SciChart3DSurface.YAxis>
<s3D:SciChart3DSurface.ZAxis>
<s3D:NumericAxis3D/>
</s3D:SciChart3DSurface.ZAxis>
<s3D:SciChart3DSurface.ChartModifier>
<s3D:ModifierGroup3D>
<s3D:TooltipModifier3D CrosshairMode="Lines" IsEnabled="True"
SourceMode="AllSeries" ShowTooltipOn="MouseOver">
</s3D:TooltipModifier3D>
</s3D:ModifierGroup3D>
</s3D:SciChart3DSurface.ChartModifier>
</s3D:SciChart3DSurface>
It is possible to change the labels on the Tooltips in SciChart WPF 3D by applying a template in XAML.
Have a look at the SciChart WPF 3D Chart Documentation on Tooltips.
Styling the Tooltip Item Template
The tooltip item template can be styled in exactly the same was as the RolloverModifier, via the TooltipModifier3D.TooltipTemplate attached property. This defines a DataTemplate for some UI which binds to an instance of SeriesInfo. For a full description of the SeriesInfo types please see RolloverModifier
<!-- where xmlns:s3D="http://schemas.abtsoftware.co.uk/scichart3D" --> <s3D:SciChart3DSurface> <s3D:SciChart3DSurface.Resources> <s3D:Vector3ComponentConverter x:Key="Vector3ComponentConverter" /> <DataTemplate x:Key="XyzSeriesTooltipTemplate" DataType="cd:BaseXyzSeriesInfo3D"> <StackPanel Orientation="Vertical"> <TextBlock> <Run FontWeight="Bold" Text="{Binding SeriesName, FallbackValue='Xyz 3D Point', TargetNullValue='Xyz 3D Point'}" /> </TextBlock> <Border Height="1" Margin="3" HorizontalAlignment="Stretch" Background="DimGray" BorderThickness="0" /> <TextBlock> <Run FontWeight="Bold" Text="X: " /> <Run Text="{Binding HitVertex, Converter={StaticResource Vector3ComponentConverter}, ConverterParameter='X'}" /> </TextBlock> <TextBlock> <Run FontWeight="Bold" Text="Y: " /> <Run Text="{Binding HitVertex, Converter={StaticResource Vector3ComponentConverter}, ConverterParameter='Y'}" /> </TextBlock> <TextBlock> <Run FontWeight="Bold" Text="Z: " /> <Run Text="{Binding HitVertex, Converter={StaticResource Vector3ComponentConverter}, ConverterParameter='Z'}" /> </TextBlock> </StackPanel> </DataTemplate> </s3D:SciChart3DSurface.Resources> <s3D:SciChart3DSurface.RenderableSeries> <s3D:XyScatterRenderableSeries3D s3D:TooltipModifier3D.IncludeSeries="False" s3D:TooltipModifier3D.TooltipTemplate="{StaticResource XyzTooltipTemplate}"//> </s3D:SciChart3DSurface.RenderableSeries> </s3D:SciChartSurface>
If you wanted to apply these changes in c# code you can also consider applying a template using the following technique or this technique.