dyerware

Support => Wordpress Plugins => Topic started by: bmlcreative on April 17, 2012, 03:23:16 PM

Title: Change the sort order of the group names on the x axis
Post by: bmlcreative 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
Title: Re: Change the sort order of the group names on the x axis
Post by: bmlcreative 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
Title: Re: Change the sort order of the group names on the x axis
Post by: doug@dyerware.com on April 21, 2012, 02:34:01 PM
Gotcha.  Ill look at it.  Sorry for the delay. 
Title: Re: Change the sort order of the group names on the x axis
Post by: doug@dyerware.com 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)
Title: Re: Change the sort order of the group names on the x axis
Post by: bmlcreative 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?
Title: Re: Change the sort order of the group names on the x axis
Post by: doug@dyerware.com on April 23, 2012, 06:09:13 PM
I'll post a replacement file here this evening for u
Title: Re: Change the sort order of the group names on the x axis
Post by: AdiLee 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
Title: Re: Change the sort order of the group names on the x axis
Post by: doug@dyerware.com on June 12, 2013, 03:16:54 PM
Hah I forgot about this.  I'm a bad admin :)

Ill look at it
Title: Re: Change the sort order of the group names on the x axis
Post by: doug@dyerware.com 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.
Title: Re: Change the sort order of the group names on the x axis
Post by: doug@dyerware.com 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!