Heatmap palette


Author
Message
Lennart Bossér
Lennart Bossér
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 5, Visits: 37
Hello,

How many colors can be handled with m_heatmap.Palette.AutoPaletteColors?

It seems to me that about the 8 first colours are used regardless of the size of the palette.
See excerpt of code below



  private byte[,] swecadecol = {{0, 0, 102},  {0, 0, 119},  {0, 0, 136},  {0, 0, 153},  {0, 0, 170},
             {0, 0, 187},  {0, 0, 204},  {0, 0, 221},  {0, 0, 238},  {0, 38, 225},
             {0, 60, 200},  {0, 137, 221}, {0, 135, 219}, {0, 181, 205}, {0, 223, 120},
             {0, 255, 128}, {0, 255, 45},  {84, 255, 84}, {85, 255, 85}, {119, 255, 119},
             {151, 255, 129}, {136, 255, 136}, {153, 255, 153}, {187, 255, 187}, {221, 255, 221},
             {255, 255, 255}, {255, 255, 187}, {255, 255, 153}, {255, 255, 119}, {255, 255, 85},
             {255, 255, 51}, {255, 255, 17}, {243, 240, 0}, {245, 243, 0}, {239, 197, 158},
             {234, 179, 128}, {228, 159, 97}, {223, 140, 66}, {255, 119, 119}, {255, 85, 85},
             {255, 68, 68}, {255, 34, 34}, {255, 17, 17}, {238, 0, 0},  {221, 0, 0},
             {187, 0, 0},  {170, 0, 0},  {136, 0, 0},  {102, 0, 0},  {68, 0, 0},
             {51, 0, 0}};
  private NHeatMapSeries m_heatmap = new NHeatMapSeries();
   m_heatmap.Palette.SmoothPalette = true;
   NArgbColorValue[] newcolors = new NArgbColorValue[51];
   for (int i = 0; i < 51; i++)
   {
      newcolors[i] = new NArgbColorValue(255, swecadecol[i, 0], swecadecol[i, 1], swecadecol[i, 2]);
   }
   m_heatmap.Palette.AutoPaletteColors = newcolors;

    ...



I expected to see the whole range of colours from dark blue via white to dark red.
But I only see dark shades of blue.

best regards,
Lennart

Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.1K
Hi Lennart,
You also need to tell the palette to use the same number of steps as the autocolors - for example in your case:
m_heatmap.Palette.PaletteSteps = 51;

Let us know if you meet any problems.


Best Regards,
Nevron Support Team


Lennart Bossér
Lennart Bossér
Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)
Group: Forum Members
Posts: 5, Visits: 37
Thank you very much, that helped.
Where do I find such information in the documentation? Sorry to bother you all the time :-)

By the way, it seems to work even better if the number of palette steps is one less than the number of colours,
in this case m_heatmap.Palette.PaletteSteps = 50;

Best regard,
Lennart


Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.1K
Hi Lennart,
Sometimes not all features / properties are well documented or in this case the combination of properties, because it is a very large control. We try to improve the documentation constantly though when we find discrepancies or if something is incorrect. Also the example sometimes are a better source to learn the API. If you don't find something or something is not quite clear please let us know Smile.

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic
2 active, 2 guests, 0 members, 0 anonymous
No members currently viewing this topic!

Login

Explore
Messages
Mentions
Search