Page 1 of 1

Exploded slice appears wrong

Posted: Fri Oct 17, 2008 3:01 am
by 5887342
Professor Narcís...;)

(using D7 with TeeChart 7.12)

======================================

I am having a problem with exploded slices. I've been battling it for three days. Don Quixote had better luck with windmills than I am with this one....

It's exactly the same issue a user described in a post in the .NET group (http://www.teechart.net/support/viewtopic.php?t=2339). In fact, I originally posted this to that thread, but noticed after the submission it was the wrong group.. DOH! Sorry for the confusion. The issue there, however, is precisely what I'm experiencing.

I noticed something that may help shed some light on the issue.

I can reproduce this (mis)behavior .. by having... and perhaps this is quite important... YValues.Order set to loNone.

Oh, another piece of the puzzle. I cause the slices to explode not by using ExplodeBiggest, but by manually setting at run time, based on various conditions, the <PieSeries.>ExplodedSlice[] array.

I'm going to bet Tony had <PieSeries.>YValues.Order set to loNone, and was manually setting the <PieSeries.>ExplodedSlice[] array as well? Tony, you watching? Actually, I posted a follow-up to the .NET thread, so we'll see.

Change YValues.Order to, say, loAscending, add the slices, do the Sort, and things will behave...Smile Switch it back to loNone, and the problem reappears.

Narcís, has this been fixed, and I'm just slow to update, or is this still an ongoing issue? I'm kind of excited to see Tony with the same issue, I know I'm not nuts now. I've read through the documentation, FAQ's, Posts, and this is the closest I've come to seeing someone else with my problem.

Oh, and additional question. I noticed at http://www.berneda.com/TeeChart6Docs/TS ... eList.html it says TSliceValueList "Contains the collection list of exploded slices and height of slices of a TPieSeries.". Does the Height property factor in here? I couldn't find any further mention of the Height property for TSliceValueList. Did it get dropped in V7?

Help!!! (and thanks in advance, Narcís!..Smile)

Regards,
richard diamond

Posted: Fri Oct 17, 2008 6:02 am
by 5887342
Follow up to this post...

Based on the observation that an ascending or descending sort fixes the problem, in TeEngine's TChartValueList.Sort procedure I remmed out the loNone check:

Code: Select all

procedure TChartValueList.Sort;
begin
 // if Order<>loNone then
     TeeSort(0,Count-1,CompareValueIndex,Owner.SwapValueIndex);
end;

That seemed to fix the problem of exploded slices created via the ExplodedSlices array looking like they're on a different level if the chart's unsorted.

Now, I know it's not the CLEANEST solution in the world, but it should at least help point in the right direction of where the actual problem is? I'd trace into it, see the real change that needs to be made, but it's comin' up on 11 at night, and my eyeballs are gettin' square.

How should this be addressed?

Oh, and it looks like the answer to my question about the height of slices in 7.x is, in fact, the TPieSeries SliceHeight of type TSliceValueList, yes?

Hopefully I'm on the right track. After three days I wanna have SOMETHING to show for my time other than creating new cuss words..;)

Regards,
richard diamond

Posted: Fri Oct 17, 2008 11:02 am
by narcis
Hi Richard,

Thanks for your feedback!
Professor Narcís...
:o I really don't deserve that.
I am having a problem with exploded slices. I've been battling it for three days. Don Quixote had better luck with windmills than I am with this one....
:lol:
It's exactly the same issue a user described in a post in the .NET group (http://www.teechart.net/support/viewtopic.php?t=2339). In fact, I originally posted this to that thread, but noticed after the submission it was the wrong group.. DOH! Sorry for the confusion. The issue there, however, is precisely what I'm experiencing.

I noticed something that may help shed some light on the issue.

I can reproduce this (mis)behavior .. by having... and perhaps this is quite important... YValues.Order set to loNone.
I can reproduce this here using v7 VCL, v8 VCL and v3 .NET.

By default YValues.Order is set to loNone and even I tried setting it to loAscending and calling Sort method the problem still occurs here. This is the code I used:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
var Series1: TPieSeries;
begin
  Series1:=TPieSeries.Create(self);
  Chart1.AddSeries(Series1);
  //Series1.YValues.Order := loAscending;
  Series1.Add(4.7, 'test value 2', clTeeColor);
  Series1.Add(95.3, 'test value 1', clTeeColor);
  //Series1.YValues.Sort;
end;
Is that the same as the code you used? Could you please modify it so that I can reproduce the same behavior you obtain?

Anyway, I've added it (TV52013467) to the VCL defect list now to be investigated and will open .NET's issue too.
Oh, and it looks like the answer to my question about the height of slices in 7.x is, in fact, the TPieSeries SliceHeight of type TSliceValueList, yes?
Yes, it's a separate ValueList.

Posted: Mon Oct 20, 2008 4:28 pm
by 9337917
Narcís,

More than not, that looks quite similar to my own code. The only difference(s) I see are so minor, they're barely worth mentioning. However, I will anyway..;)

o I have a TeeChart component already on the form, the Series already created

o I explicitly assign colors, or use the (AWESOME) TeeChart Color Palette feature, and use your pre-supplied palettes

o I add using AddY, rather than Add. However, I changed my code to use Add, and I saw the same behavior as I reported

It'll work if I rem out, within the TChartValueList procedure, the check for loNone. Keep that in, it misbehaves. Change my sort to loAscending or loDescending, all is well. That's consistent.

Again, for what it's worth, that's with V7.12 (and Delphi 7.0, Build 7.1). VERY odd that it doesn't work for you if your sort method is not loNone. Hmmm.....

Thanks..:)
Regards,
richard diamond

Posted: Tue Oct 21, 2008 8:38 am
by narcis
Hi richard,

Thanks for the information.

Yes, that's somewhat strange. Would you be so kind to send us a simple example project we can run "as-is" to check if what works fine for you also works fine here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.