Page 1 of 1
Piechart, adding items to the piechart error
Posted: Mon Oct 26, 2009 2:09 pm
by 15653372
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
Re: Piechart, adding items to the piechart error
Posted: Mon Oct 26, 2009 3:09 pm
by yeray
Hi SPS,
Could you please attach here a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Re: Piechart, adding items to the piechart error
Posted: Mon Oct 26, 2009 3:27 pm
by 15653372
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.
Re: Piechart, adding items to the piechart error
Posted: Tue Oct 27, 2009 9:54 am
by yeray
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.
Re: Piechart, adding items to the piechart error
Posted: Tue Oct 27, 2009 10:21 am
by 15653372
Hi,
Oops sorry for that, i'm glad you got it to work.
And tnx for taking a look at it.
Re: Piechart, adding items to the piechart error
Posted: Tue Oct 27, 2009 10:36 am
by yeray
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) + "...";
}
}
Re: Piechart, adding items to the piechart error
Posted: Tue Oct 27, 2009 12:40 pm
by 15653372
Thank you, but your workaround also works when the window is being resized?
Re: Piechart, adding items to the piechart error
Posted: Tue Oct 27, 2009 2:30 pm
by yeray
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.
Re: Piechart, adding items to the piechart error
Posted: Fri Dec 04, 2009 2:46 pm
by 15653372
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.
Re: Piechart, adding items to the piechart error
Posted: Fri Dec 04, 2009 3:05 pm
by narcis
Hi SPS,
No, this issue hasn't been fixed yet. When do those errors occur?
Thanks in advance.
Re: Piechart, adding items to the piechart error
Posted: Tue Dec 08, 2009 10:34 am
by 15653372
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?
Re: Piechart, adding items to the piechart error
Posted: Wed Dec 09, 2009 10:42 am
by narcis
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.
Re: Piechart, adding items to the piechart error
Posted: Tue Apr 27, 2010 1:45 pm
by 15653372
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.
Re: Piechart, adding items to the piechart error
Posted: Wed Apr 28, 2010 3:12 pm
by yeray
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.