Pre loader

colormap control; specify ticks, labels

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

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.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies