Sorting a Series.

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
MVBobj
Newbie
Newbie
Posts: 34
Joined: Fri Jul 17, 2015 12:00 am
Contact:

Sorting a Series.

Post by MVBobj » Tue Sep 01, 2015 6:27 pm

Hi,

I have a series which is loaded with the top 20 (could be 30, 40, 80 or any number) sales totals in descending order. I want to be able to click a button and have it switch the display from "high to low" to "low to high" (or the other way around) without reloading the series.

I've looked through this forum and all I can find is how to sort by labels or the xlabel but not by the yvalue unless I set the new sort order and reload the series.

How do I do this without reloading the series?
.

MVBobj
Newbie
Newbie
Posts: 34
Joined: Fri Jul 17, 2015 12:00 am
Contact:

Re: Sorting a Series.

Post by MVBobj » Tue Sep 01, 2015 9:51 pm

Hi,

Here is what I'd like to be able to do - these 2 images:

Programatically be able to set what appears to be Series1.General.Options.Sort to "Bar Ascending" or to "Bar Descending".

How do I do that?
.
Attachments
TeeChart2.jpg
TeeChart2.jpg (134.84 KiB) Viewed 7533 times
TeeChart1.jpg
TeeChart1.jpg (142.79 KiB) Viewed 7523 times

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Sorting a Series.

Post by Yeray » Wed Sep 02, 2015 11:12 am

Hello,

Try with this:

Code: Select all

  Series1.YValues.Order:=loDescending; //or loAscending
  Series1.CheckOrder;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply