View unanswered posts | View active topics It is currently Thu May 09, 2024 12:15 am



Reply to topic  [ 3 posts ] 
Modify x-values and date format 
Author Message
Regular pChart user
Regular pChart user

Joined: Fri Feb 25, 2011 5:35 pm
Posts: 11
Post Modify x-values and date format
Hello,

this is my second post in this forum and I hope to have answers as soon as possible :)

I have 2 questions here :

1. How to have the same chart like in the print-screen but with less x-values (less dates).
2. And the second question is how to format the date in mysql format ("2011-03-01") to "d-m-y" format. I have tried :
Code:
$MyData->setAxisDisplay(1,AXIS_FORMAT_TIME,"d-m-y");

but it dont works.

Image

And here is my 2 arrays with var_dump:
array(12) { [0]=> string(10) "2011-01-03" [1]=> string(10) "2011-01-04" [2]=> string(10) "2011-01-05" [3]=> string(10) "2011-01-06" [4]=> string(10) "2011-01-07" [5]=> string(10) "2011-01-10" [6]=> string(10) "2011-01-11" [7]=> string(10) "2011-01-12" [8]=> string(10) "2011-01-13" [9]=> string(10) "2011-01-14" [10]=> string(10) "2011-01-17" [11]=> string(10) "2011-01-18" }

array(12) { [0]=> string(4) "1.12" [1]=> string(4) "1.13" [2]=> string(4) "1.18" [3]=> string(4) "1.17" [4]=> string(4) "1.18" [5]=> string(4) "1.18" [6]=> string(4) "1.19" [7]=> string(4) "1.22" [8]=> string(4) "1.28" [9]=> string(4) "1.31" [10]=> string(4) "1.30" [11]=> string(4) "1.32" } 12


Thanks a lot !!!


Tue Mar 01, 2011 2:56 pm
Profile
Regular pChart user
Regular pChart user

Joined: Tue Feb 08, 2011 10:36 pm
Posts: 14
Post Re: Modify x-values and date format
For the first question, you may want to look at the option in drawScale called LabelSkip to see if this may help. I was making a graph where I was showing every hour, but I only wanted to show every 24th hour, so i added the LabelSkip option at 24 and it worked perfectly.

For the 2nd question you may want to look at using AXIS_FORMAT_DATE

Hope this helps.


Tue Mar 01, 2011 4:19 pm
Profile
Regular pChart user
Regular pChart user

Joined: Fri Feb 25, 2011 5:35 pm
Posts: 11
Post Re: Modify x-values and date format
Thanks a lot,

this have helped a little, but I have not what I want :(

I want to fix a fixed number of labeles in X Axis (Always 5 lables for example).


Thanks for more help.


Wed Mar 02, 2011 10:00 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron