Author Topic: Change the sort order of the group names on the x axis  (Read 8037 times)

bmlcreative

  • Tadpole
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
    • Email
Change the sort order of the group names on the x axis
« on: April 17, 2012, 03:23:16 PM »
Hi,

Thanks for this great plugin - it works beautifully. The only thing I'm wondering if there is a way to reorder the key of group names on the x-axis.

Here is the shortcode that I am using:

[easychart type="horizbar" title="Customer course rating (over past 5 years)" height="300" width="350" chartfadecolor="FFFFFF"
groupnames="Excellent,Good,OK,Poor" valuenames="2012,2011,2010,2009,2008"
group1values="110, 135, 160, 140, 75"
group2values="33, 20, 42, 27, 30"
group3values="7, 11, 2, 6, 9"
group4values="1, 0, 2, 0, 0"
groupcolors="B91127,333333,666666,999999"]

Even though the groupname order above is 'Excellent > Good > OK > Poor', it is currently displaying in the x-axis as 'OK > Good > Poor > Excellent'.

It's only a minor point, but would be great if the order of the groupnames in the axis key could match the order on the chart.

Any help on achieving this would be greatly appreciated.

Cheers

Dave

bmlcreative

  • Tadpole
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
    • Email
Re: Change the sort order of the group names on the x axis
« Reply #1 on: April 19, 2012, 08:26:51 AM »
Bump!

Sorry guys - really need some advice on this one if possible... even if it's just a point in the right direction to the coding that controls the sort order?

Cheers

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Change the sort order of the group names on the x axis
« Reply #2 on: April 21, 2012, 02:34:01 PM »
Gotcha.  Ill look at it.  Sorry for the delay. 

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Change the sort order of the group names on the x axis
« Reply #3 on: April 21, 2012, 07:56:26 PM »
Ok I recall this now  8).  The sort order is based on the longest value when using a horizontal graph.  Try vertical.
Also a stacked graph tweaks the order from frontmost to rear (kind of the reverse of the horizontal)

bmlcreative

  • Tadpole
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
    • Email
Re: Change the sort order of the group names on the x axis
« Reply #4 on: April 23, 2012, 09:53:18 AM »
Thanks for the reply - unfortunately, changing the chart to a vertbar doesn't effect the sort order of the key. The order of the key doesn't seem to be related to the longest value, because if it did, then the order would be as I need it to.

The only thing I can see that it might be, is by number of characters in the value title determines the order, so:

OK (= 1st because only 2 characters), Good (= 2nd because has 4 characters), Poor (Also 4 characters but 3rd due to alphabetical sorting?), Excellent (= 4th due to having 9 characters)....

This is only a guess but is the only pattern/logic I can see?

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Change the sort order of the group names on the x axis
« Reply #5 on: April 23, 2012, 06:09:13 PM »
I'll post a replacement file here this evening for u

AdiLee

  • Tadpole
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Change the sort order of the group names on the x axis
« Reply #6 on: June 12, 2013, 01:31:30 PM »
Im having the same problem. Have you guys found a solution for this. Amazing plugin by the way

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Change the sort order of the group names on the x axis
« Reply #7 on: June 12, 2013, 03:16:54 PM »
Hah I forgot about this.  I'm a bad admin :)

Ill look at it

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Change the sort order of the group names on the x axis
« Reply #8 on: June 30, 2013, 01:37:19 PM »
Ok just a quick update: The table at the bottom is always showing the group titles as they appear in the shortcut.

doug@dyerware.com

  • Administrator
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: +15/-0
    • View Profile
    • Email
Re: Change the sort order of the group names on the x axis
« Reply #9 on: June 30, 2013, 01:54:54 PM »
Ok an update is in the app store.  Horizontal bar graph label axis is now going to match your ordering in the shortcode (just as the values table does).

Sorry about the delay!

 

anything