Page 1 of 1

Horizontal x-axis labels are ordered alphabetically?!

Posted: Wed Jul 08, 2009 4:42 pm
by giovannic
Hi all!
Trying to use the chartengine to get my charts I got an issue.
Whe I try do design a barsgrouped graph type my horizontal x-axis
labels are ordere alphabetically and not numerically.
IMHO this is a bug becausa if I have labels 1,5,10,15 I've to see numbers
in this order but I see them in 1,10,15,5 order...
The data are correct but the visualization of them it's not correct.
In my case IE numbers are month of the year and I can't present my
data with October immediatly after January!

Then another little bug! Always in barsgrouped chart these labels are not
disposed correctly. At this time this is a minor bug for me as I relocate the
buttons manually, but it's a bug of course!

There is a way to have this problems solved?
I hope u can reply to this post ASAP. Bye

PS: for a complete information I use chartEngine with Windows and MacOS and I've these problems in both systems. Bye

Posted: Thu Jul 09, 2009 9:32 am
by malte
Hi Giovanni,

[edit: deleted insomniatic complete nonsense here]

For the second problem I would love to see a screenshot, along with some information on the font and textsize you were using. If you could send me that, I'd be very grateful.

Thanks for the report,

Malte

Posted: Thu Jul 09, 2009 12:54 pm
by malte
Hi giovanni,

seems I read your post wrong. Can you please send me the stack / script you use to display your data, along with some demo data? Of course the numeric sorting should work the way you expect it.

Cheers,

Malte

Posted: Thu Jul 09, 2009 1:03 pm
by malte
Please forgive me. I really need to get some sleep it seems. :D

Here is a testScript I wrote that renders correctly:

on mouseUp pMouseBtnNo
local tChart
chartsCreateChart "test"
put the result into tChart
set the charts["data"] of tChart to the text of fld 1
set the charts["chartStyle"] of tChart to "barsGrouped"
set the charts["gridX"] of tChart to 1
set the charts["dataIncludesX"] of tChart to true
chartsRefresh tChart
end mouseUp

the Stack has one button and a field with the following contents:

5,20,30
10,3,45
15,50,20
20,30,30

This renders just the way I would expect it.

I would really like to see your stack if it goes wrong.

Thank u

Posted: Thu Jul 09, 2009 1:23 pm
by giovannic
Hi!
First of all TY for ur replies and excuse me for my delay!

The, I've found why I've this unexpected behaviour.
I use the charts["dataIncludesX"] property set to false.
In this case my chart labels series automatically but sort numbers
alphabetically.
I can try to set this property to true at the moment but, for my use,
can be better to have a property to set the sort type for labels.
U think this can be done is next version?
Ur simple code seems does not solve the second bug I've reported
so, for better identification, I'll post two screenshot of my work in which
every series of data is a month.
In the first u can see about my first observation. xAxis labels are relocated by me.
In the second shot u can see the same chart generated without my relocation code of labels executed.

Thank u.

First shot :
Image

Second shot:
Image

Posted: Thu Jul 09, 2009 1:56 pm
by malte
Hi giovanni,

if dataIncludesX is false chartsEngine suspect the first item of your data to be not the label, but actually data it should render. Can you send me (off list if you prefer) the data you want to display, along with the stack / script you use to display the data? The second thing I see for your labeling is the charts["gridX"] property. set this to 1 if you want to draw every label, otherwise it will only display each nth label (as set in the gridX property). Maybe the docs are not clear enough about this.

Cheers,

Malte

Posted: Thu Jul 09, 2009 1:58 pm
by malte
By the way, the next version will indeed allow for more fleibility for the labeling. If any features you like to see come to mind, please do not hesitate to post them!

:D

Posted: Thu Jul 09, 2009 3:46 pm
by giovannic
Here it is a sample of data I've to represent with the chart:

0,0
1000.00,0
0,0
0,0
0,0
50.00,1322.74
0,-500.00
0,0
0,0
0,0
0,0
0,0

Every line represent an amount of something for a month
(there are 12 lines) and in every line I've an item for each
year (IE, 1st item of 1st line is for january in 2008 and the
2nd item of 1st line is for january in 2009 etc.)
If u use these data with ur sample code above setting the
dataIncludesX to false u'll see the descripted behaviour.

See u

PS: right now I really don't know why my labels are not
correctly positioned. I'll try to exclude all properties I've
used one by one to see which of em cause the issue.
Bye

Eureka!!!

Posted: Thu Jul 09, 2009 3:59 pm
by giovannic
I've found it!!!
I use in my chart thecharts["gridXDescriptionOrientation"] set to "Normal"
This value for this property cause the problem with the alignment of labels.
If I comment this line in my code all xAxis labels are positioned correctly.
U can easily reproduce it.
Add the following line to ur sample code above:

set the charts["gridXDescriptionOrientation"] of tChart to "Normal"

and render the chart.
Hope u can fix it.
Bye-

PS: it's the same issue of this thread:
http://forums.runrev.com/phpBB2/viewtop ... f44e2eaff9

Re: :D

Posted: Thu Jul 09, 2009 4:07 pm
by giovannic
malte wrote:If any features you like to see come to mind, please do not hesitate to post them!
It Would be great if u can introduce "text" labeling for data! ;D
If I'm not wrong right now I can only use "date" labelling.

Posted: Thu Jul 09, 2009 6:20 pm
by malte
Drats! I thought I fixed that bugger in 1.0.4. Argh. Bear with me for a few hours. That is embarrasing!

I will let you know.

Cheers,

Malte

Posted: Sat Jul 11, 2009 7:39 am
by malte
quick note:

I found where it goes wrong, however the fix is not too trivial. I must make sure that I do not break the other labeling, so I prefer to give it a bit time for testing before I post a test version.

Cheers,

Malte

Posted: Sun Jul 12, 2009 8:55 pm
by malte
Hi giovanni,

should be fixed:

http://derbrill.de/downloads/chartsEngine_105.zip

Please let me know if this version works for you.

All the best,

Malte

Thank you!

Posted: Mon Jul 13, 2009 10:28 am
by giovannic
Hi Malte!
Thank you for ur replies.
I've read of the 1.05 version so I'm going to download and try it!

I'll give my feedback ASAP.
Bye-

It goes!

Posted: Tue Jul 14, 2009 1:48 pm
by giovannic
Hi Malte.
With 1.05 the horizontal alignment it's OK.
Then, can we expect another version with other updates soon?
(IE solution for problems about the initial title of this post? or the text x-axis labeling? :D)

See u and thank u for this update! Bye