SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & 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.

1
0

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.

Version
4.0.6.8482
  • Andrew
    Hi Kevin, Im discussing this with Yuriy. Can you clarify the issue? SciChart should redraw if you change the HeatmapRenderableSeries.ColorMap property to a new colormap. It won’t redraw if you change a gradient stop or a color on an existing colormap as we don’t listen to property changed events on the Gradient stops.
  • Kevin Yeh
    Hi Andrew. I attached some sample code to the original post to demonstrate the issue. It is a modified version of the 2D Heatmap example. I added a combobox to the MainWindow that is bound to a ColorMap property. The Heatmap is also bound to this via a ColorMapConverter (similar to the BoolToValueConverter you implemented in the previous solution).If you switch between the Gray and Cool colormaps (both have 2 Gradient Stops), the colorbar refreshes, but the heatmap doesn’t. The same thing happens when you switch between the Jet and Rainbow colormaps (6 gradient stops).If you switch between Gray (2) and Jet (6), both the colorbar and heatmap refresh.If you replicate gradient stops such that no colormaps have the same number of stops, everything works fine.
  • Yuriy
    Hi Kevin, please try out the latest build #v4.0.6.8512. We believe the issue is fixed there. You can get it through our NuGet feed: http://support.scichart.com/index.php?/Knowledgebase/Article/View/17232/37/getting-nightly-builds-with-nuget
  • Kevin Yeh
    Thanks! The problem is fixed.
  • You must to post comments
0
0

Hi Kevin,

Thanks for letting us know! The reason why it was implemented in this way is for better performance. Not sure if we will be able to change it, but I’ve logged it for investigation anyway. We will take a look and see what can be done about this.

UPDATE:

The issue has been fixed in the build #v4.0.6.8512. You can get it through our NuGet feed.

Best regards,
Yuriy

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.