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

0
0

As the name suggests, does the Heatmap (specifically the new UniformHeatmap in v5) respect the ResamplingMode? And if not, can it? 🙂

Basic tests here seem to indicate that it doesn’t. I am displaying large quantities of data, and I need to have control over the resampling algorithm as the user zooms out.

Thanks,
Mike.

Version
5
  • You must to post comments
0
0

Hi Mike

The heatmap is not resampled. In v5 we do however perform some optimisations internally (such as not bothering to write to a pixel more than once).

You can – if you have source code access – modify our heatmap source for direct access to the RenderSurface. In v5 we basically draw to texture then blit that texture to the screen. However other than that, it’s not possible to modify how the heatmap draws.

In fact, you might be able to achieve this by overriding one method and customizing the drawing.

Try this:

public class HeatmapCustom : FastUniformHeatmapRenderableSeries
{
    protected override void GetColorDataForTexture(int xStartInd, int textureWidth, int xInc, int yStartInd, int textureHeight, int yInc)
    {
        var pp = PaletteProvider as IHeatmapPaletteProvider;
        var colorMap = ColorMap;

        Action<int> iterateX = new Action<int>(y =>
        {
            // This function populates an integer array of ARGB colors 
            var xInd = xStartInd;
            var yInd = yStartInd + y * yInc;
            for (int x = 0; x < textureWidth; x++, xInd += xInc)
            {
                _colorData[y * textureWidth + x] = GetColor(yInd, xInd, colorMap, pp);
            }
        });

        var allowsMultiThread = GetParentSurface().EnableMultiThreadedRendering;
        if (allowsMultiThread)
        {
            Parallel.For(0, textureHeight, iterateX);
        }
        else
        {
            for (int y = 0; y < textureHeight; y++)
            {
                iterateX(y);
            }
        }
    }
}

I have made BaseHeatmapRenderableSeries.GetColor protected virtual for you in build v5.0.0.10614 so that you can use this workaround.
This build is being published now to our nightly build feed.

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.