Help with Exchange() method
Posted: Thu Sep 21, 2006 8:51 pm
Delphi 6 Enterprise, TeeChart Pro 7.07
I am working with a simple pie chart. I want the user to be able to specify two indexes and have them swap position in the chart. I see an Exchange() method that is supposed to do that. Unfortunately, it doesn't appear to work correctly - that or I am really misunderstanding something.
I use the code: Series1.XValues.Exchange(1, 4);
where Series1 is a PieSeries that has 8 slices. I am trying to swap slices #1 and #4. When I run the code, the chart is never refreshed on screen. Repaint doesn't help, RefreshSeries doesn't help, and Invalidate doesn't help.
Tracing the code into the body of the TChartValueList.Exchange method in TeEngine.pas, I am able to watch the values in the local Value[] array. The values have indeed been swapped. Where the array used to list the numeric values (0, 1, 2, 3, 4, 5, 6, 7, 0...) it now lists (0, 4, 2, 3, 1, 5, 6, 7, 0...).
Unfortunately, the actual chart doesn't change on screen to reflect the values being updated. How can I make this refresh on screen?
The only workaround I have been able to determine thus far is to assign things to a temporary Series, exchange it, and then assign it back to my orignal chart. Please tell me there is a better way to accomplish my task.
Thank you,
Rich
I am working with a simple pie chart. I want the user to be able to specify two indexes and have them swap position in the chart. I see an Exchange() method that is supposed to do that. Unfortunately, it doesn't appear to work correctly - that or I am really misunderstanding something.
I use the code: Series1.XValues.Exchange(1, 4);
where Series1 is a PieSeries that has 8 slices. I am trying to swap slices #1 and #4. When I run the code, the chart is never refreshed on screen. Repaint doesn't help, RefreshSeries doesn't help, and Invalidate doesn't help.
Tracing the code into the body of the TChartValueList.Exchange method in TeEngine.pas, I am able to watch the values in the local Value[] array. The values have indeed been swapped. Where the array used to list the numeric values (0, 1, 2, 3, 4, 5, 6, 7, 0...) it now lists (0, 4, 2, 3, 1, 5, 6, 7, 0...).
Unfortunately, the actual chart doesn't change on screen to reflect the values being updated. How can I make this refresh on screen?
The only workaround I have been able to determine thus far is to assign things to a temporary Series, exchange it, and then assign it back to my orignal chart. Please tell me there is a better way to accomplish my task.
Thank you,
Rich