SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
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.
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
Please login first to submit.