Page 1 of 1

ColorGrid AddPalette

Posted: Tue Apr 10, 2007 5:38 pm
by 9527947
Hello,

I am not able to set negative values in the AddPalette() function of the ColorGrid object. I would like to map colors to values that range from -z1 to +z2, for example. I am using the following loop to create the colormap for two graphs (m_SpecColorGrid, which is used for a spectrogram, and PaletteColorGrid, which is used as the legend for the spectrogram). The result is a legend that goes from the first positive color to the last positive color (only the positive half is created):

Any suggestions? Thanks.
Marc


double dCurrentHeight = dRange;
double dDeltaHeight = dRange / COLOR_LEVELS;
for (int k = COLOR_LEVELS - 1; k >= 1; --k)
{
double color = double(k) / double(COLOR_LEVELS);
PaletteColorGrid.AddPalette(dCurrentHeight, RainbowColor(color));
m_SpecColorGrid.AddPalette(dCurrentHeight, RainbowColor(color));
dCurrentHeight -= dDeltaHeight;
}

Posted: Wed Apr 11, 2007 8:32 am
by narcis
Hi TTL,

AddPalette method with negative values works fine here as you can see on this thread. Can you please check if it works fine at your end?

If the problem persists could you please send us a simple example project we can run "as-is" to reproduce the problem here and let us know which TeeChart version are you using?

You can post your files at news://www.steema.net/steema.public.attachments newsgroups or at www.steema.net/upload.

Thanks in advance.