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

0 votes
2k views

I want to have Y axis starting at 0 at the bottom and max value at the top, but I also want 0 index in heatmap data buffer to be displayed at the max value. I was able to achieve that using your HeatMapExampleView by modifying CreateSeries method like this

return new Heatmap2DArrayDataSeries<int, int, double>(data, ix => ix, iy => h - iy);

Note the iy => h – iy. What I noticed is that after doing that the RolloverModifier stopped working. How can I fix this or is this a bug?

  • Rok Rode asked 3 years ago
  • last active 3 years ago
1 vote
3k views

Hi,

I may have run into a bug with the 2d heatmap where it doesn’t refresh. I implemented a ColorMapConverter similar to the solution here: https://www.scichart.com/questions/question/how-to-switchdefine-multiple-fastheatmaprenderableseries-colormap-for-the-same-chart

The Brushes are defined as

    <LinearGradientBrush x:Key="DefaultBrush">
        <GradientStop Offset="0" Color="DarkBlue" />
        <GradientStop Offset="0.2" Color="CornflowerBlue" />
        <GradientStop Offset="0.4" Color="DarkGreen" />
        <GradientStop Offset="0.6" Color="Chartreuse" />
        <GradientStop Offset="0.8" Color="Yellow" />
        <GradientStop Offset="1" Color="Red" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="JetBrush">
        <GradientStop Offset="0" Color="#00008F" />
        <GradientStop Offset="0" Color="#00008F" />
        <GradientStop Offset="0.125" Color="#0000FF" />
        <GradientStop Offset="0.375" Color="#00FFFF" />
        <GradientStop Offset="0.625" Color="#FFFF00" />
        <GradientStop Offset="0.875" Color="#FF0000" />
        <GradientStop Offset="1" Color="#800000" />
    </LinearGradientBrush>

The chart will only refresh if the number of gradient stops is different. My workaround is to replicate the first GradientStop in JetBrush. If I remove this line, the chart will not refresh. The colorbar still refreshes correctly, but not the heatmap surface.

I’d like to implement many different colormaps and for now it seems like I can keep replicating GradientStops. I thought it was worth mentioning just in case it’s a bug. Anyway, please let me know if there is a better way to do this.

  • Kevin Yeh asked 3 years ago
  • last active 3 years ago
Showing 2 results
This template supports the sidebar's widgets. Add one or use Full Width layout.