SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

0
0

I have a “live” color map control. Range of Z-values always comprehends zero, but is not symmetrical about zero. I would like to show only the tick at zero (and no others), and only the label ‘0’ (no formatting) at that tick. Is there a simple solution?

Version
SciChart_v5.3.0.11954
Images
  • You must to post comments
0
0

Hi Harry,

There’s a property on HeatmapColorMap called AxisStyle. This accepts a WPF Style which is applied to the axis inside the heatmapcolormap.

As an example of use, we have one in our Non Uniform Heatmap example

      <s:HeatmapColorMap Margin="40,20"
                      Grid.Column="1"
                      HorizontalAlignment="Right"
                      VerticalAlignment="Stretch"
                      Background="{Binding Source={x:Reference Name=sciChart}, Path=Background}"
                      Foreground="{Binding Source={x:Reference Name=sciChart}, Path=Foreground}"
                      ColorMap="{Binding Source={x:Reference Name=heatmapSeries}, Path=ColorMap.GradientStops, Converter={StaticResource ColorsToLinearGradientBrushConverter}}"
                      Minimum="{Binding Source={x:Reference Name=heatmapSeries}, Path=ColorMap.Minimum, Mode=TwoWay}"
                      Maximum="{Binding Source={x:Reference Name=heatmapSeries}, Path=ColorMap.Maximum, Mode=TwoWay}"
                      TextFormatting="0.00"
                      Opacity="0.8"
                      BorderBrush="#777"
                      BorderThickness="1"
                      Orientation="Vertical" >
        <s:HeatmapColorMap.AxisStyle>
            <Style TargetType="{x:Type s:NumericAxis}">
                <Setter Property="Margin" Value="-15,0,-10,0"/>
                <Setter Property="DrawMajorTicks" Value="False"/>
                <Setter Property="DrawMinorTicks" Value="False"/>
                <Setter Property="DrawMajorGridLines" Value="False"/>
                <Setter Property="DrawMinorGridLines" Value="False"/>
            </Style>
        </s:HeatmapColorMap.AxisStyle>
    </s:HeatmapColorMap>

With this style you can do anything to the heatmap’s axis that you can to a normal SciChartSurface’s axis. For example, if you wanted to hide all ticks except zero then you could use the TickProvider API.

See here for example of use.

So your final solution might look something like this:

      <s:HeatmapColorMap>
           ... 
            <s:HeatmapColorMap.Resources> 
                 <!-- Create and declare a tick provider --> 
                 <CustomTickProvider x:Key="CustomTickProvider"/>
            </s:HeatmapColorMap.Resources> 

            <s:HeatmapColorMap.AxisStyle>
                 <Style TargetType="{x:Type s:NumericAxis}">
                     <Setter Property="TickProvider" Value="{DynamicResource CustomTickProvider}"/>
                 </Style>
            </s:HeatmapColorMap.AxisStyle>
      </s:HeatmapColorMap>

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

SciChart WPF v6 BETA released! Note pricing/licensing changes are coming. Contact us to beat the rise!Read more
+