Piechart, adding items to the piechart error

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
SPS
Newbie
Newbie
Posts: 27
Joined: Tue May 26, 2009 12:00 am

Piechart, adding items to the piechart error

Post by SPS » Mon Oct 26, 2009 2:09 pm

Hello,

I am getting an error when im trying to add items to the piechart. A colleague also encoutered the same problem but with a different control.
The error is:

Width must be non-negative.

When i add items to the piechart with a small width, everything works fine, but with a little bit larger objects it crashes.

Can this be fixed?

tnx in advance

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

Re: Piechart, adding items to the piechart error

Post by Yeray » Mon Oct 26, 2009 3:09 pm

Hi SPS,

Could you please attach here a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
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

SPS
Newbie
Newbie
Posts: 27
Joined: Tue May 26, 2009 12:00 am

Re: Piechart, adding items to the piechart error

Post by SPS » Mon Oct 26, 2009 3:27 pm

Hi, ofcourse. Check it out.

Play a little bit with the measurements of the window, when the width is big enough it works else it doesnt.
Attachments
TestCharting.rar
(11.92 KiB) Downloaded 453 times

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

Re: Piechart, adding items to the piechart error

Post by Yeray » Tue Oct 27, 2009 9:54 am

Hi SPS,

The example project you've sent is using the GSLibrary that I don't have here. Could you please send us a simple example that only uses the default libraries and the TeeChart one?

Thanks in advance.

Update:
I've removed the reference and changed the chart construction and could reproduce it. I'm investigating what's happening.
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

SPS
Newbie
Newbie
Posts: 27
Joined: Tue May 26, 2009 12:00 am

Re: Piechart, adding items to the piechart error

Post by SPS » Tue Oct 27, 2009 10:21 am

Hi,

Oops sorry for that, i'm glad you got it to work.
And tnx for taking a look at it.

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

Re: Piechart, adding items to the piechart error

Post by Yeray » Tue Oct 27, 2009 10:36 am

Hi SPS,

It seems that there is a problem in WPF that makes the application cash when having a too width mark. I've added it to the wish list to be fixed in future releases (TW16014509) but in the meanwhile maybe you could check that the labels length isn't too large. For example you could use series' marks OnGetMarksText event as follows:

Code: Select all

        public Window1()
        {
            InitializeComponent();

            
            tchart.Chart.Series.Add(new Steema.TeeChart.WPF.Styles.Pie());
            tchart.Chart.Aspect.View3D = false;
            tchart.Legend.Visible = false;
            tchart.Chart.Series[0].Add(4, "TESTESTETETETETEETETETETTESTESTETETETETEETETETET");
            tchart.Chart.Series[0].Add(6, "s");
            tchart.Chart.Series[0].Add(1, "s");
            tchart.Chart.Series[0].Add(9, "s");
            tchart.Chart.Series[0].Add(4, "s");

            tchart[0].GetSeriesMark += new Steema.TeeChart.WPF.Styles.Series.GetSeriesMarkEventHandler(Window1_GetSeriesMark);
        }

        void Window1_GetSeriesMark(Steema.TeeChart.WPF.Styles.Series series, Steema.TeeChart.WPF.Styles.GetSeriesMarkEventArgs e)
        {
            if (e.MarkText.Length > 20)
            {
                e.MarkText = e.MarkText.Substring(0, 17) + "...";
            }
        }
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

SPS
Newbie
Newbie
Posts: 27
Joined: Tue May 26, 2009 12:00 am

Re: Piechart, adding items to the piechart error

Post by SPS » Tue Oct 27, 2009 12:40 pm

Thank you, but your workaround also works when the window is being resized?

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

Re: Piechart, adding items to the piechart error

Post by Yeray » Tue Oct 27, 2009 2:30 pm

Hi SPS,

It was an example of workaround. If your chart will be resized, the 20 constant (note that the 17 constant is the 20 without the three points) should be recalculated. This will probably be proportional to the Chart width.
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

SPS
Newbie
Newbie
Posts: 27
Joined: Tue May 26, 2009 12:00 am

Re: Piechart, adding items to the piechart error

Post by SPS » Fri Dec 04, 2009 2:46 pm

Hello,

Is there some news about this issue, because the solution you gave me, will sometimes still create an error.
I hope it will be fixed in the next release?

Thanks in advance.

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

Re: Piechart, adding items to the piechart error

Post by Narcís » Fri Dec 04, 2009 3:05 pm

Hi SPS,

No, this issue hasn't been fixed yet. When do those errors occur?

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

SPS
Newbie
Newbie
Posts: 27
Joined: Tue May 26, 2009 12:00 am

Re: Piechart, adding items to the piechart error

Post by SPS » Tue Dec 08, 2009 10:34 am

It depends on the information that is being shown in the piechart, with large information it will still crash even with the solution you gave me.
I see there is a new release, isnt it fixed in that release?

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

Re: Piechart, adding items to the piechart error

Post by Narcís » Wed Dec 09, 2009 10:42 am

Hi SPS,
It depends on the information that is being shown in the piechart, with large information it will still crash even with the solution you gave me.
Can you please attach a simple example project with which we can reproduce the issue here?
I see there is a new release, isnt it fixed in that release?
No, it's not listed in the release notes mentioned in the new release announcement.
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

SPS
Newbie
Newbie
Posts: 27
Joined: Tue May 26, 2009 12:00 am

Re: Piechart, adding items to the piechart error

Post by SPS » Tue Apr 27, 2010 1:45 pm

Hello, i was wondering if there is a solution already. It has been a couple of months ago and we need it to move on.

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

Re: Piechart, adding items to the piechart error

Post by Yeray » Wed Apr 28, 2010 3:12 pm

Hi SPS,

I'm afraid that the ticket with number [TW16014509] hasn't been closed yet. Please, be aware at this forum or subscribe to our RSS news feed for new release announcements and what's implemented on them.
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

Post Reply