Pre loader

Using a LinearGradientBrush for coloring with a custom paletteprovider z values in Xy scatter plot

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

I am using heatmaps in my application and would love to use the same color scheme that is used for those also in my xyz scatter plots. I know how to make palette providers I just don’t know how to get a specific color that is defined by a lineargradientbrush (defined in xaml) for a specific (relative value? 0.0-1.0 ). Is this possible?

  • You must to post comments
0
0

We actually have the code to do this buried in our Heatmap2DArrayDataSeries.

Basically what we do is:

  1. Create a System.Windows.Shapes.Rectangle with size Width=1000, Height=1
  2. Set Rectangle.Fill = to the LinearGradientBrush
  3. Render the Rectangle to bitmap using RenderTargetBitmap

That becomes our color-map.

Next when you want to know a color value, you can simply get and read the color of the Nth pixel, where 0 corresponds to 0.0 and 1000 corresponds to 1.0.

Let me know if that helps!

Best regards,
Andrew

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies