Page 1 of 1

Working with high/a lot of values with ColorGrid

Posted: Thu Mar 24, 2011 9:14 am
by 13047077
Hello,

I'm stumbling on a problem for a day now, I'm trying to work with a ColorGrid to display some data. Here is the problem :

first I can't add a value with an x value bigger than 19999, otherwise the chart just go mad (big red cross in the middle of it). I haven't try with z values but I'm expecting the same problem. This is annoying as I plan to use that colorgrid with X values between 1 200 000 000 and 1 700 000 000 (up to 3 000 000 000). There are gonna be about 4000 values to add per X line. By the way is there any way of choosing the length of a cell, or define a span for them ? (so I can spread my 4000 values over my ~500 000 000 span).
This one is not really a problem, but more of a question, is it possible to "start" the grid not at (0,0) ? again that's because I won't have any data between 0 and ~1 200 000 000.

ps : oh and I wanted the left axis to ba a DateTime axis, is it possible ?

Kind regards,
Benoit Chevalier

Re: Working with high/a lot of values with ColorGrid

Posted: Fri Mar 25, 2011 10:29 am
by 10050769
Hello Frances
I'm stumbling on a problem for a day now, I'm trying to work with a ColorGrid to display some data. Here is the problem :
first I can't add a value with an x value bigger than 19999, otherwise the chart just go mad (big red cross in the middle of it). I haven't try with z values but I'm expecting the same problem. This is annoying as I plan to use that colorgrid with X values between 1 200 000 000 and 1 700 000 000 (up to 3 000 000 000). There are gonna be about 4000 values to add per X line. By the way is there any way of choosing the length of a cell, or define a span for them ? (so I can spread my 4000 values over my ~500 000 000 span).
I think you can use IrregularGrid = true, as do in next link where can explain how use ColorGrid.
This one is not really a problem, but more of a question, is it possible to "start" the grid not at (0,0) ? again that's because I won't have any data between 0 and ~1 200 000 000
Yes. You can do something as next:

Code: Select all

        Steema.TeeChart.Styles.ColorGrid series1; 
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            series1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
            series1.IrregularGrid = true;
            series1.Add(10000,0,0.5);
            series1.Add(12000,0,0.5);
            series1.Add(5000, 0, 0.5);

            series1.Add(10000,1.1,0.6);
            series1.Add(12000,1.5,0.6);
            series1.Add(5000,1.3,0.6);

            series1.Add(10000,2,0.75);
            series1.Add(12000,2,0.75);
            series1.Add(5000, 2, 0.75);
    
        }
ps : oh and I wanted the left axis to ba a DateTime axis, is it possible ?
Yes is possible. You must put YValues.DateTime property to true as do in next line of code:

Code: Select all

 series1.YValues.DateTime = true;
I hope will helps.
Thanks,

Re: Working with high/a lot of values with ColorGrid

Posted: Fri Mar 25, 2011 11:04 am
by 13047077
Hello Sandra,
Unfortunately I still have some troubles.

I eventually found out about the DateTime property and that for ColorGrid the Y and Z values are kind of "permuted".
About the DateTime, my problem is now that no Add() functions seems to be existing for adding DateTime in another row than X, so I used Utils.DateTime(aDateTime) to return a double I can add as a Z value in order to have it on my Y axis.

long story short we end up with something like that :

m_Data.Title = "Gain";
m_Data.Visible = true;
//m_Data.UsePalette = false;
m_Data.UseColorRange = false;
m_Data.UsePalette = true;
m_Data.UseColorRange = true;
m_Data.XValues.DataMember = "X";
m_Data.YValues.DataMember = "Y";
m_Data.ZValues.DataMember = "Z";
m_Data.Pen.Visible = false;
m_Data.IrregularGrid = true;
m_Data.YValues.DateTime = true;
m_Data.ZValues.DateTime = true;

//blahblah, do some work

m_Data.Add(frequency,gain, Utils.DateTime(aDateTime),FindColor(gain));

This kind of do the work, but still raise another problem : no X or Z values can apparently be higher than 19999. Otherwise the chart is getting buggy (big red cross in the middle of a blank background). And Utils.DateTime(now) =~ 40000. So it's impossible for me to add a data a a current time. Plus my X data has to go from 0 up to 3 000 000 000, which is obviously way more than 19999. Do you have any idea where that limit come from and if there's a way to override it ? (I have set m_Data.NumXValues = int.MaxValue;m_Data.NumZValues = int.MaxValue; but that doesn't seem to work).

Kind regards

Re: Working with high/a lot of values with ColorGrid

Posted: Mon Mar 28, 2011 9:57 am
by 10050769
Hello Frances,

I could reproduce your problem using next code and we have added it in bug report list with number [TF02015464] we will try to fix it for next maintenance releases of TeeChart.Net :

Code: Select all

        Steema.TeeChart.Styles.ColorGrid series1; 
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            series1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
            series1.IrregularGrid = true;
            series1.XValues.DateTime = true;

            Random y = new Random();

            for (int x = 0; x < 100; x++)
            {
                DateTime dt = DateTime.Now;

                for (int z = 0; z < 100; z++)
                {
                    dt = dt.AddDays(1);
                    series1.Add(x, y.Next(100), dt.ToOADate());                      
                }
            }    
        }
Can you confirm that if previous code reproduce your problem?

Thanks,

Re: Working with high/a lot of values with ColorGrid

Posted: Mon Mar 28, 2011 10:19 am
by 13047077
Hello Sandra,

Yes it does reproduce my problem (any date bigger than now is way bigger than 20 000, which is the number making the chart crash). But here is even simpler :

tChart1.Aspect.View3D = false;
series1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
series1.IrregularGrid = true;

series1.Add(24000, y.Next(100), y.Next(100));

That should reproduce the problem as well.

Kind Regards

Re: Working with high/a lot of values with ColorGrid

Posted: Mon Mar 28, 2011 11:03 am
by 10050769
Hello Frances,

Thank you to information. Could you tell us which version are you using? So we only can reproduce your problem, when we are using DateTime, but not using last code that you suggested.

Code: Select all

tChart1.Aspect.View3D = false;
series1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
series1.IrregularGrid = true;

series1.Add(24000, y.Next(100), y.Next(100)); 
Thanks,

Re: Working with high/a lot of values with ColorGrid

Posted: Tue Mar 29, 2011 1:17 pm
by 13047077
Hello Sandra,

I'm using TeeChart for .NET v3 (3.5.3470.15475). I just tried adding a 24 000 value at runtime, and it does crash (m_Data.Add(index, gain, 0, FindColor(gain)); with index = 24000).

Kind regards

Re: Working with high/a lot of values with ColorGrid

Posted: Tue Mar 29, 2011 3:40 pm
by 10050769
Hello Frances,

You don't use last update build of TeeChart.Net version 3. I recommend that download the last update build of version 3, that you can find in custom download page and check again if next code works fine:

Code: Select all

        Steema.TeeChart.Styles.ColorGrid series1;
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            series1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
            series1.IrregularGrid = true;
            // series1.XValues.DateTime = true;

            Random y = new Random();

            for (int x = 0; x < 100; x++)
            {
                DateTime dt = DateTime.Now;

                for (int z = 0; z < 100; z++)
                {
                    // dt = dt.AddDays(1);

                    series1.Add(24000, y.Next(100), y.Next(100));
                }
            }
        }
Thanks,

Re: Working with high/a lot of values with ColorGrid

Posted: Wed Mar 30, 2011 6:59 am
by 13047077
Hello Sandra,
I've updated my version to the last build. Surprisingly (for me) your code does work fine, but the problem seems to be slightly different, as this one does not work :

Random y = new Random();

for (int x = 0; x < 100; x++)
{
DateTime dt = DateTime.Now;

for (int z = 0; z < 100; z++)
{
// dt = dt.AddDays(1);

m_Data.Add(1000, y.Next(100), y.Next(100));
}
}

m_Data.Add(24000, y.Next(100), y.Next(100));


Looks like we have to add a bunch of values before, and then when adding a big value afterwards the chart crash.

Kind regards

Edit : after a few try I found out that :
m_Data.Add(10000, y.Next(100), y.Next(100)); followed by m_Data.Add(29998, 132, 124); does not crash
m_Data.Add(10000, y.Next(100), y.Next(100)); followed by m_Data.Add(29999, 132, 124); does crash
seems like values can't be more different than 19998.

Re: Working with high/a lot of values with ColorGrid

Posted: Wed Mar 30, 2011 12:35 pm
by 10050769
Hello Frances,

Thank you for information. I could reproduce it and we have added your request in bug list with number [TF02015465]. We will try to fix it for next maintenance releases of TeeChart.Net.

Thanks,

Re: Working with high/a lot of values with ColorGrid

Posted: Wed Apr 06, 2011 11:04 am
by 10050769
Hello Frances,

After we do many tests I inform you that the bug whit number (TF02015464) is not a bug so the problem there are with next code:

Code: Select all

        Steema.TeeChart.Styles.ColorGrid series1;
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            series1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
            series1.IrregularGrid = true;
            series1.XValues.DateTime = true;

            Random y = new Random();

            DateTime dt;

            for (int x = 0; x < 100; x++)
            {
                dt = DateTime.Now; 
                for (int z = 0; z < 100; z++)
                {
                    dt = dt.AddDays(1);
                    series1.Add(x, y.Next(100), dt.ToOADate());
                }
            }
        } 
is that dt value is different on each loop of x value. So if you do something as next:

Code: Select all

   Steema.TeeChart.Styles.ColorGrid series1;
        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            series1 = new Steema.TeeChart.Styles.ColorGrid(tChart1.Chart);
            series1.IrregularGrid = true;
            series1.XValues.DateTime = true;

            Random y = new Random();

            DateTime dt;

            for (int x = 0; x < 100; x++)
            {
                 dt = DateTime.Today;
                for (int z = 0; z < 100; z++)
                {
                    dt = dt.AddDays(1);
                    series1.Add(x, y.Next(100), dt.ToOADate());
                }
            }
        } 
The problem disappears and works fine. Could you confirm that it works fine to you using last version of TeeChart.Net?

Thanks,

Re: Working with high/a lot of values with ColorGrid

Posted: Fri Apr 08, 2011 9:35 am
by 10050769
Hello Frances,

I inform that but with number(TF02015465) is not a bug because It's by design. All TChart series that derive from Custom3DGrid work in the same way. Data has to describe a grid of (X, Z) values that have the same spaces between them, and your code to make works doesn't comply with this prerequisite. Please take a look again in this link: http://www.teechart.net/support/viewtop ... ant#p19750 to follow the prerequisites that you need of your ColorGrid works correctly.

Thanks,