Creating BoxPlots Dynamicly

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
FP_Oz
Newbie
Newbie
Posts: 22
Joined: Mon Oct 01, 2007 12:00 am

Post by FP_Oz » Tue Jul 08, 2008 7:21 pm

Hi Narcis,
Thanks for your ever-optimistic reply.
Your array-idea sound interesting as a intermediate solution (the real solution will no doubt be in the next SW update).
I never used custom-made series before. Could you help me on my way with a couple of lines of code to create a boxplot series?

Cheers
Francis

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jul 09, 2008 7:21 am

Hi Francis,

Here you can find an example of a custom series I created.
Best Regards,
Narcís Calvet / 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

FP_Oz
Newbie
Newbie
Posts: 22
Joined: Mon Oct 01, 2007 12:00 am

Re: box- whiskers revisited

Post by FP_Oz » Wed Apr 06, 2011 10:50 pm

Hi Narcis,
In 2008 you put the box-whisker plots (BWP) on the to-do list (adding a series of box-whiskers to the gallery, replacing the fairly impractical 'single BWP' approach).
Narcís wrote: Yes, exactly :wink:. I've just added this item.
At the time I had a look at your 'array' solution and didn't understand how that would meet my needs.
Anyway, I'm still hanging out for a useable box-whisker series (proudly advertised by Steema) and I was wondering if anything had been done in the past years to improve that situation?

Also, I'm using candle series to emulate box-whiskers. The problem I've been unable to solve over the years is that the colour of the candle in the legend is different to the one on the plot, which is very confusing for users. Any hint how to deal with that one?

Cheers
Francis

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

Re: Creating BoxPlots Dynamicly

Post by Sandra » Thu Apr 07, 2011 2:20 pm

Hello Francis,

Please can you take a look in my answer in this thread.

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

FP_Oz
Newbie
Newbie
Posts: 10
Joined: Tue May 17, 2011 12:00 am

Re: Creating BoxPlots Dynamicly

Post by FP_Oz » Wed May 18, 2011 12:12 am

Hi Sandra
The answer pertains to the legend color problem (not resolved yet) and I've posted a reply to your answer.
I'm still looking for an anwer re the box-whisker plot (BWP). When I first brought up the issue about each single BW being a series on its own, I requested a more mature apprach where a BW series contain a collection of BW (you would not have a separate series for each point in a point series, would you?). Looking forward to a solution,
Regards
Francis

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Creating BoxPlots Dynamicly

Post by Yeray » Fri May 20, 2011 11:08 am

Hello francis,
FP_Oz wrote:At the time I had a look at your 'array' solution and didn't understand how that would meet my needs.
Please, don't hesitate to ask anything you feel we haven't explained enough clearly.
Here it is an example of how you could create a custom Boxes class that has an array of Steema.TeeChart.Styles.Box. And how you could have an Add(double x, double[] y) method that creates a new Box series, adds it to the array and populates it with the given data.

Code: Select all

        public class Boxes
        {
            public Steema.TeeChart.Styles.Box[] boxes;
            private Steema.TeeChart.Chart chart;

            public Boxes(Steema.TeeChart.Chart c) {
                chart = c;
                boxes = new Steema.TeeChart.Styles.Box[0];
            }

            public int Add(double x, double[] y)
            {
                Steema.TeeChart.Styles.Box[] newBoxes = new Steema.TeeChart.Styles.Box[boxes.Length+1];
				boxes.CopyTo(newBoxes, 0);
                boxes = newBoxes;

                boxes[boxes.Length - 1] = new Steema.TeeChart.Styles.Box(chart);
                boxes[boxes.Length - 1].Add(x, y);

                return boxes.Length-1;
            }
        }

        private double[] GenerateYValues(int num)
        {
            double[] YValues = new double[num];

            Random r = new System.Random();
            int n = num * (3 + r.Next(10));
            YValues[0] = -n;
            for (int t = 2; t < num; t++) YValues[t-1] = (n * t / num);
            YValues[num-1] = (2 * n);

            return YValues;
        }

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            Boxes MyBoxes1 = new Boxes(tChart1.Chart);

            Random r = new Random();
            for (int i = 0; i < 4; i++)
                MyBoxes1.Add(i, GenerateYValues(r.Next(20)+20));
        }
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

FP_Oz
Newbie
Newbie
Posts: 10
Joined: Tue May 17, 2011 12:00 am

Re: Creating BoxPlots Dynamicly

Post by FP_Oz » Tue Jun 14, 2011 3:51 am

Hi Yeray,
As said in a previous post, Steema's support for uncertainty in its graphs is quite basic and it is really an area that could do with a bit more attention imo.

Re the box-whisker plot plot: thanks for the array 'workaround' example, but it again does not answer my question about a more mature approach to the BWP.
As said, you could have single-point point series and ask users to put them into an array to form a multi-point series and let them then manage the array instead of the series. Fortunately Steema did not choose for such a silly solution for its point series, and my (now very long standing) request is to 'standardise' the BWP to Steema's general approach of having the array as part of the series. If Steema is not willing to review its approach to BWP please let me know so I can stop wasting all our time pursuing this issue.

Also, I don't seem to get an email alert anymore when there is a response posted on the forum. Could you find out why that is so?

Regards
Francis

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Creating BoxPlots Dynamicly

Post by Narcís » Thu Jun 16, 2011 9:18 am

Hi Francis,
Re the box-whisker plot plot: thanks for the array 'workaround' example, but it again does not answer my question about a more mature approach to the BWP.
As said, you could have single-point point series and ask users to put them into an array to form a multi-point series and let them then manage the array instead of the series. Fortunately Steema did not choose for such a silly solution for its point series, and my (now very long standing) request is to 'standardise' the BWP to Steema's general approach of having the array as part of the series. If Steema is not willing to review its approach to BWP please let me know so I can stop wasting all our time pursuing this issue.
Please bear in mind that BoxPlot series has a YValues ValueList and a number of Y values are used to plot each box. Median, Q1, Q3, whiskers, outliers, etc.; are calculated from given Y values so that the user doesn't have to care about calculating anything. Users just have to provide all those Y values to each box. Given that, I'm afraid it would not be possible to fit what you request in TeeChart's standard series design paradigm which generally assumes a 1:1 correspondence for X and Y values. So I guess an implementation to your request would be similar to Yeray's suggestion. Anyway, we will consider it to be revised and included in future releases.
Also, I don't seem to get an email alert anymore when there is a response posted on the forum. Could you find out why that is so?
Could you please check that the email address in your forums account is valid?

Thanks in advance.
Best Regards,
Narcís Calvet / 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

FP_Oz
Newbie
Newbie
Posts: 10
Joined: Tue May 17, 2011 12:00 am

Re: Creating BoxPlots Dynamicly

Post by FP_Oz » Sat Jun 18, 2011 2:58 pm

Thanks for your reply Narcis.
I checked my email address and that is the correct one. Any other suggestion why I don't get an alert?
Cheers
Francis

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Creating BoxPlots Dynamicly

Post by Narcís » Mon Jun 20, 2011 8:21 am

Hi Francis,

Could you please confirm that you checked the "Subscribe topic" option at the bottom of the thread? If the answer is affirmative, could you check that those emails don't get trapped in a SPAM folder?

Thanks in advance.
Best Regards,
Narcís Calvet / 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

FP_Oz
Newbie
Newbie
Posts: 10
Joined: Tue May 17, 2011 12:00 am

Re: Creating BoxPlots Dynamicly

Post by FP_Oz » Tue Jun 28, 2011 7:39 pm

Hi Narcis,
I'm pretty sure the emails are not trapped in the email filter and the substribe box on the bottom of the screen does has a tick in it. I'll redo the subscription to see if that helps (btw, can you see who has subscribed to a subject?).
Cheers
Francis

FP_Oz
Newbie
Newbie
Posts: 10
Joined: Tue May 17, 2011 12:00 am

Re: Creating BoxPlots Dynamicly

Post by FP_Oz » Tue Jun 28, 2011 7:48 pm

Aah, I can see what's happening.
A ticked box means that you're NOT subscribed but invites you to subscribe (bit confusing for the small mind).

I've now been using TChart for 15 years or so. Am I right that after 25 years you're 'newbie' status is changed to 'beginners' :D ?

Cheers
Francis

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Creating BoxPlots Dynamicly

Post by Narcís » Wed Jun 29, 2011 7:28 am

Hi Francis,
A ticked box means that you're NOT subscribed but invites you to subscribe (bit confusing for the small mind).
Yes, not very clear. This is a phpBB default feature I'm afraid.
I've now been using TChart for 15 years or so. Am I right that after 25 years you're 'newbie' status is changed to 'beginners' :D ?
At 100 posts user status changes to "Advanced" and at 1000 changes to "Guru". We could create some intermediate ranks though :wink:
Best Regards,
Narcís Calvet / 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