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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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.