ColorGrid Legend Colors
Posted: Fri Feb 22, 2013 2:21 pm
I have created a ColorGrid and I am using a 64 color custom Palette. The ColorGrid works perfectly with the assigned colors. The legend values are also showing correctly, however the color boxes next to the values are all White. Using the ChartEditor, I can switch to a built in Palette which changes the colors on the ColorGrid as well as the Legend colors.
Here is the code that I use to create the Palette.
private void DoPalette()
{
ColorGrid.ClearPalette();
ColorGrid.UseColorRange = false;
ColorGrid.UsePalette = true;
ColorGrid.PaletteSteps = 20;
double dMinimum = .400;
double dMaximum = .500;
double dStep;
ColorGrid.PaletteMin = dMinimum;
double dWallSpan = dMaximum - dMinimum;
dStep = dWallSpan / 64.0;
double value = dMinimum;
//use 64 color palette previously created on main form
for(int i=0;i<64;i++){
ColorGrid.AddPalette(value, Form1.Frm1.Pallet64Color);
value += dStep;
}
}
//======================================================
I create the palette before any data is added to the chart. If I "Re-create" the palette after some data is added, I will get possibly 1 or 2 colors at the top and bottom end of the legend only with everything in between being white. I have attached a picture of my chart showing the problem
thanks,
Kev
Here is the code that I use to create the Palette.
private void DoPalette()
{
ColorGrid.ClearPalette();
ColorGrid.UseColorRange = false;
ColorGrid.UsePalette = true;
ColorGrid.PaletteSteps = 20;
double dMinimum = .400;
double dMaximum = .500;
double dStep;
ColorGrid.PaletteMin = dMinimum;
double dWallSpan = dMaximum - dMinimum;
dStep = dWallSpan / 64.0;
double value = dMinimum;
//use 64 color palette previously created on main form
for(int i=0;i<64;i++){
ColorGrid.AddPalette(value, Form1.Frm1.Pallet64Color);
value += dStep;
}
}
//======================================================
I create the palette before any data is added to the chart. If I "Re-create" the palette after some data is added, I will get possibly 1 or 2 colors at the top and bottom end of the legend only with everything in between being white. I have attached a picture of my chart showing the problem
thanks,
Kev