Dear support team.
It seems that the Order property of TBarSeries.YValues does not work correctly. In the FAQ, you write:
--------------------------------------------------------------------------------
Q: How do I sort Series in an ascending/descending order?
If you already added points to series and just want to sort them in descending order, add
DELPHI CODE :
Series1.Yvalues.Order:=loDescending;
--------------------------------------------------------------------------------
But this line of code has absolutely no effect on the chart. You can easilyverify this by creating a small sample program with one chart and onehorizontal bar series and a button with the following OnClick event:
Series.FillSampleValues(24);
Series.YValues.Order := loDescending;
Best regards,
Joachim Marder
JAM Software
Order property of TBarSeries.YValues does not work
Hi, Joachim.
True, code used in FAQ pages will not work. It's a "bug" in documentation. But the following code will work fine:
BTW, which FAQ page (link) are you refering to? I tried to find and fix it (new faq pages) but I could not find it
True, code used in FAQ pages will not work. It's a "bug" in documentation. But the following code will work fine:
Code: Select all
Series1.XValues.Order := loNone;
Series1.YValues.Order := loAscending;
Series1.YValues.Sort;
Series1.XValues.FillSequence;
Series1.Repaint;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Dear Marjan.
First of all, thanks for the speedy reply. Unfortunately the code sample does not do what it promises, because it seems that FillSequence changes the YValues to 1,2,3,... You can easily test this by copy&pasting the code to a simple test program with a horizontal bar series.
The link to the FAQ is:
http://www.steema.com/support/faq/NewVC ... BAR.htm#Q4
Unfortunately your code sample is no replacement for the code sample in the FAQ. Any help on how to sort a bar chart dynamically is appreciated.
And there's one more documentation bug: The TChartValueList.Sort method is missing in the help file.
Best regards,
Joachim Marder
First of all, thanks for the speedy reply. Unfortunately the code sample does not do what it promises, because it seems that FillSequence changes the YValues to 1,2,3,... You can easily test this by copy&pasting the code to a simple test program with a horizontal bar series.
The link to the FAQ is:
http://www.steema.com/support/faq/NewVC ... BAR.htm#Q4
Unfortunately your code sample is no replacement for the code sample in the FAQ. Any help on how to sort a bar chart dynamically is appreciated.
And there's one more documentation bug: The TChartValueList.Sort method is missing in the help file.
Best regards,
Joachim Marder
Hi, Joachim.
http://www.teechart.net/support/modules ... %20/%20CLX
Aha, the "old" FAQ pages. These pages have been updated for the latest TeeChart version. New FAQ pages can be accessed at:
http://www.teechart.net/support/modules ... %20/%20CLX
The code is for normal vertical series type. For horizontal series type, you should swap x and y values i.e. use the followingpromises, because it seems that FillSequence changes the YValues to 1,2,3,... You can easily test this by copy&pasting the code to a simple test program with a horizontal bar series.
Code: Select all
Series1.YValues.Order := loNone;
Series1.XValues.Order := loAscending;
Series1.XValues.Sort;
Series1.YValues.FillSequence;
Series1.Repaint;
I think this is documented in TeeChart v6 help files.And there's one more documentation bug: The TChartValueList.Sort method is missing in the help file.
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Dear Marjan.
Yes, swapping X and YValues did the trick. Thank you very much for your assistance. The only problem that is left for me is that I have a stacked series and now must sort the second series according to the first one. Can this be done with TeeChart?
Thanks and best regards,
Joachim Marder
JAM Software
Yes, swapping X and YValues did the trick. Thank you very much for your assistance. The only problem that is left for me is that I have a stacked series and now must sort the second series according to the first one. Can this be done with TeeChart?
BTW, it seems that this question is missing in the new FAQ.Aha, the "old" FAQ pages. These pages have been updated for the latest TeeChart version
Neither in the help file, nor on http://www.berneda.com/TeeChart6Docs/TC ... thods.html I was able to find the Sort method documentes.I think this is documented in TeeChart v6 help files.
Thanks and best regards,
Joachim Marder
JAM Software
Hi, Joachim.
Re "missing FAQ entry" : fixed, just added it.
Re "missing Sort method" : hmm... Ok, noted. There is a reference to Sort method in FillSequence method help entry. But Sort is not documented. We'll try to improve this for TeeChart v7.0 release.
Re "missing FAQ entry" : fixed, just added it.
Re "missing Sort method" : hmm... Ok, noted. There is a reference to Sort method in FillSequence method help entry. But Sort is not documented. We'll try to improve this for TeeChart v7.0 release.
Marjan Slatinek,
http://www.steema.com
http://www.steema.com