Page 1 of 1
ColorGrid reset the StartColor & EndColor values
Posted: Tue Jul 21, 2009 5:28 am
by 13046152
Dear Support,
In colorgrid we want to reset the StartColor and EndColor values for series values. For example if the series values are 1,2,3,4,5,6,7,8,9 and 10 then StartColor white will be assigned to value 1 and EndColor red will be assigned to 10 in color grid, but if I want to assign the start color value as 5 instead of 1 and end color value as 8 instead of 10 then how to achieve this.
Faster reply will be appreciated.
Thanks
Muthu Kumar
Gvs_Kumar@jubilantbiosys.com
Jubilant Biosys.
Re: ColorGrid reset the StartColor & EndColor values
Posted: Tue Jul 21, 2009 9:37 am
by 10050769
Hello vivek,
If you want to assigned diferents colors in the colorgrid, you need to use a custom palette. I recomened that see this
post, that explain exactly how do for creat a custom palette.
I hope will helps,
Thanks
Re: ColorGrid reset the StartColor & EndColor values
Posted: Tue Jul 28, 2009 6:04 am
by 13046152
Dear Sandra,
Please see the attachment to understand my requirements and reply. I had gone through your link and it will not serve my purpose.
Thanks again,
Muthu Kumar
Jubilant Biosys.
Re: ColorGrid reset the StartColor & EndColor values
Posted: Tue Jul 28, 2009 10:57 am
by 10050769
Hello vivek,
I think, you should assign a palette for each of the color grids. Please, try to assign the palettes, and check that solve your problem.
I hope that will helps.
Thanks,
Re: ColorGrid reset the StartColor & EndColor values
Posted: Wed Jul 29, 2009 6:43 am
by 13046152
Dear Sandra,
In that case I can't scale the color across the grid from min.(white) color value to max.(red). Moreover it will degrade the performance.
Thanks,
Muthu Kumar
Jubilant Biosys.
Re: ColorGrid reset the StartColor & EndColor values
Posted: Thu Jul 30, 2009 8:17 am
by 10050769
Hello vivek,
I have made an example, that you could use for solve your problem of ColorGrid using 2 palettes. Please check that next example solve your problem.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.ColorGrid colorgrid1;
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
colorgrid1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
Random rnd = new Random();
int count;
count = 0;
double[] xValues = new double[48];
double[] yValues = new double[48];
double[] zValues = new double[48];
for (double x = 0; x < 6; ++x)
{
for (double y = 0; y < 8; ++y)
{
xValues[count] = x;
zValues[count] = y;
if (rnd.Next(100) <= 25)
{
yValues[count] = rnd.Next(100) - 25;
}
else
{
yValues[count] = rnd.Next(100);
}
++count;
}
}
colorgrid1.Add(xValues, yValues, zValues);
colorgrid1.Marks.Visible = true;
colorgrid1.Marks.Transparent = true;
colorgrid1.UsePalette = true;
colorgrid1.UseColorRange = false;
colorgrid1.Palette.Clear();
colorgrid1.AddPalette(-15, Color.FromArgb(255,255,255));
colorgrid1.AddPalette(0,Color.FromArgb(255,220,220));
colorgrid1.AddPalette(10, Color.FromArgb(255,189,189));
colorgrid1.AddPalette(20, Color.FromArgb(255,179,179));
colorgrid1.AddPalette(30, Color.FromArgb(255, 149, 149));
colorgrid1.AddPalette(40, Color.FromArgb(255, 138, 138));
colorgrid1.AddPalette(60, Color.FromArgb(255, 0, 0));
colorgrid1.AddPalette(61, Color.FromArgb(0,0,255));
}
private void AddPallete_Click(object sender, EventArgs e)
{
colorgrid1.UsePalette = true;
colorgrid1.UseColorRange = false;
colorgrid1.Palette.Clear();
colorgrid1.AddPalette(-15, Color.FromArgb(255, 255, 255));
colorgrid1.AddPalette(0, Color.FromArgb(0, 0, 0));
colorgrid1.AddPalette(10, Color.FromArgb(255, 189, 189));
colorgrid1.AddPalette(20, Color.FromArgb(255, 179, 179));
colorgrid1.AddPalette(30, Color.FromArgb(255, 149, 149));
colorgrid1.AddPalette(40, Color.FromArgb(255, 138, 138));
colorgrid1.AddPalette(60, Color.FromArgb(255, 0, 0));
colorgrid1.AddPalette(61, Color.FromArgb(0, 0, 255));
tChart1.Refresh();
}
private void button1_Click(object sender, EventArgs e)
{
tChart1.Series.Clear();
InitializeChart();
}
I hope will helps.
Thanks,