TChartSeries SortByLabels() - upper case before lower case?
TChartSeries SortByLabels() - upper case before lower case?
Hi.
I noticed that the function SortByLabels() of TChartSeries sorts not correct alphabetically:
All labels that starts with an upper case char will be sorted before any lower case chars. That means "Zap" will be located before "apple"!
I am using TeeChart V8.04.
Is this a known issue?
Can you provide a solution for this behavior.
Thanks!
I noticed that the function SortByLabels() of TChartSeries sorts not correct alphabetically:
All labels that starts with an upper case char will be sorted before any lower case chars. That means "Zap" will be located before "apple"!
I am using TeeChart V8.04.
Is this a known issue?
Can you provide a solution for this behavior.
Thanks!
Hi marder,
Well, as you probably know, "A" and "a" have different ascii codes and that's why they are considered as different characters.
Anyway, I've added it to the wish list to be studied as a possible enhancement for further releases (TV52013868).
Well, as you probably know, "A" and "a" have different ascii codes and that's why they are considered as different characters.
Anyway, I've added it to the wish list to be studied as a possible enhancement for further releases (TV52013868).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi again marder,
For now, the only thing I think you could do would be forcing all the labels to start with uppercase or downcase, as you prefer.
For now, the only thing I think you could do would be forcing all the labels to start with uppercase or downcase, as you prefer.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi Yeray
"airport", "Austarlia", "bag", "Berlin"
Your chart does it like this:
"Austarlia", "Berlin", "airport", "bag"
which is not really usable.
Is there no other way to sort the values correctly?
Maybe with a custom compare function for chart values?
Thanks!
Yes, I am aware of that, but I would expect a correct alphabetic sorting like this:Well, as you probably know, "A" and "a" have different ascii codes and that's why they are considered as different characters.
"airport", "Austarlia", "bag", "Berlin"
Your chart does it like this:
"Austarlia", "Berlin", "airport", "bag"
which is not really usable.
I use the chart to show files of a file system, which can ether start with a lower or upper case. It is no solution for me to modify the file names before adding them to the chart!For now, the only thing I think you could do would be forcing all the labels to start with uppercase or downcase, as you prefer.
Is there no other way to sort the values correctly?
Maybe with a custom compare function for chart values?
Thanks!
Hi marder,
No, you don't need to change your file names, only the chart labels. For example:
I hope it helps.
No, you don't need to change your file names, only the chart labels. For example:
Code: Select all
for i:=0 to Series1.Count-1 do
Series1.Labels[i]:=LowerCase(Series1.Labels[i]);
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi Yeray.
With my post before I meant that it is now solution for me to show modified file names (not actually modify the file names physically).
Sorry if my post was unclear.
The problem is:
1. The user will wonder why all his files are shown in lower case.
2. Not all file systems are case insensitive (e.g. Unix/Linux). When I try to trigger any action (e.g.: Open the file when double click on the slice) the application will not be able to detect the file based on the labels.
So, are there any other alternatives for this issue?
Thanks for you time!
I know what you mean. I got this.No, you don't need to change your file names, only the chart labels.
With my post before I meant that it is now solution for me to show modified file names (not actually modify the file names physically).
Sorry if my post was unclear.
The problem is:
1. The user will wonder why all his files are shown in lower case.
2. Not all file systems are case insensitive (e.g. Unix/Linux). When I try to trigger any action (e.g.: Open the file when double click on the slice) the application will not be able to detect the file based on the labels.
So, are there any other alternatives for this issue?
Thanks for you time!
Hi marder,
Well, while the enhancement isn't implemented, you always can:
1. Do a copy of the original filenames in a array of strings.
2. Change the labels to downcase as suggested before to achieve your desired order.
3. Show the text from your array using OnGetMarkText.
Well, while the enhancement isn't implemented, you always can:
1. Do a copy of the original filenames in a array of strings.
2. Change the labels to downcase as suggested before to achieve your desired order.
3. Show the text from your array using OnGetMarkText.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi marder,
A date hasn't been fixed yet but I think a new maintenance release could be available by the end of this quarter or beginning of 2nd quarter.
We can not guarantee that, it's too early. It has just been reported today, it's a quite specific need and there's a workaround available.Do you think that this enhancement will be implemented in one of the next releases?
Do you have any idea when this release will be public?
A date hasn't been fixed yet but I think a new maintenance release could be available by the end of this quarter or beginning of 2nd quarter.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: TChartSeries SortByLabels() - upper case before lower case?
Hi again.
I am currently updating to Delphi XE2 and within this process I did update TeeChart Pro to V2011.
I am very sad to see, that "SortByLabels" still sorts incorrectly.
Could you please tell me why this function was not corrected in the last 2 years?
Is there now a way to do use a custom compare function of to obtain a comparer object to the series?
Thanks and best regards.
I am currently updating to Delphi XE2 and within this process I did update TeeChart Pro to V2011.
I am very sad to see, that "SortByLabels" still sorts incorrectly.
Could you please tell me why this function was not corrected in the last 2 years?
Is there now a way to do use a custom compare function of to obtain a comparer object to the series?
Thanks and best regards.
Re: TChartSeries SortByLabels() - upper case before lower case?
Hello marder,
I've checked it and added a new property Labels.IgnoreCase, false by default. Setting it to true makes the SortByLabels function to be case sensitive.
For example, this code shows the bars in the "AaBb" order:
And calling SortByLabels(loDescending) shows the bars in the contrary order "bBaA".
This will be available with the next maintenance release.
I've checked it and added a new property Labels.IgnoreCase, false by default. Setting it to true makes the SortByLabels function to be case sensitive.
For example, this code shows the bars in the "AaBb" order:
Code: Select all
uses Series;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.AddSeries(TBarSeries);
Chart1[0].Add(1,'a');
Chart1[0].Add(2,'A');
Chart1[0].Add(3,'b');
Chart1[0].Add(4,'B');
Chart1[0].Labels.IgnoreCase:=true;
Chart1[0].SortByLabels(loAscending);
end;
This will be available with the next maintenance release.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TChartSeries SortByLabels() - upper case before lower case?
Dear Yeary.
That’s exactly what I was looking for!
Thanks for the fast reply and the prompt implementation!
Do you have any idea when this release will be available (Later this year?)?
Is there a chance to get a prerelease version?
Best regards.
That’s exactly what I was looking for!
Thanks for the fast reply and the prompt implementation!
Do you have any idea when this release will be available (Later this year?)?
Is there a chance to get a prerelease version?
Best regards.
Re: TChartSeries SortByLabels() - upper case before lower case?
Hello,
If the following change hasn't been sent to customers already,
I would suggest to call the property CaseSensitive, like the property of TStringList.
Regards,
Bert
If the following change hasn't been sent to customers already,
Code: Select all
Chart1[0].Labels.IgnoreCase:=true;
Regards,
Bert
Re: TChartSeries SortByLabels() - upper case before lower case?
Hello,
If you are a source code customer we can send you the units modified. But I think you aren't, so I'm afraid you'll have to wait for the next maintenance release, hopefully not so long.
The editor will also have a checkbox to the series editor to access it.
I'm afraid I can't tell you a date for the next maintenance release. But I think as soon as we'll have finished fixing the problems the support for XE2 presented.marder wrote:Do you have any idea when this release will be available (Later this year?)?
Is there a chance to get a prerelease version?
If you are a source code customer we can send you the units modified. But I think you aren't, so I'm afraid you'll have to wait for the next maintenance release, hopefully not so long.
Right, it's more consistent. Just modified.Bert B. wrote:I would suggest to call the property CaseSensitive, like the property of TStringList.
The editor will also have a checkbox to the series editor to access it.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: TChartSeries SortByLabels() - upper case before lower case?
Hello Yeray.
I actually updated to source code edition a few weeks ago (when updating to TeeChart V2011).
Best regards.
I actually updated to source code edition a few weeks ago (when updating to TeeChart V2011).
Best regards.