ColorGrid reset the StartColor & EndColor values

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
vivek
Newbie
Newbie
Posts: 40
Joined: Thu Jul 19, 2007 12:00 am

ColorGrid reset the StartColor & EndColor values

Post by vivek » Tue Jul 21, 2009 5:28 am

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.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: ColorGrid reset the StartColor & EndColor values

Post by Sandra » Tue Jul 21, 2009 9:37 am

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
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

vivek
Newbie
Newbie
Posts: 40
Joined: Thu Jul 19, 2007 12:00 am

Re: ColorGrid reset the StartColor & EndColor values

Post by vivek » Tue Jul 28, 2009 6:04 am

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.
Attachments
ColorGrid StartColor and EndColor value customization.gif
ColorGrid StartColor and EndColor value customization.gif (66.68 KiB) Viewed 9410 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: ColorGrid reset the StartColor & EndColor values

Post by Sandra » Tue Jul 28, 2009 10:57 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

vivek
Newbie
Newbie
Posts: 40
Joined: Thu Jul 19, 2007 12:00 am

Re: ColorGrid reset the StartColor & EndColor values

Post by vivek » Wed Jul 29, 2009 6:43 am

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.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: ColorGrid reset the StartColor & EndColor values

Post by Sandra » Thu Jul 30, 2009 8:17 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply