1

I am trying to use date values for the xaxis but cannot find any documentation on how to do so.

I found this for the old version of pchart but the function calls are not the same in the new version of pchart. http://pchart.sourceforge.net/documentation.php?topic=advexemple20

For example my Y values are 10, 20, 30 and my X values are 2012-03-31, 2012-04-20, 2012-05-25. I cannot figure out how to add the dates using the addpoints.

I've read that you are to use the unix time stamp but then I get lost with how to format the xaxis in pcharts.

Dan
  • 1,041
  • 1
  • 12
  • 32
  • The current version of the documentation is here: http://wiki.pchart.net/ - With which part of setting data values for the xaxis you have got a problem in specific? What you look for might be called title/titles, label/labels or caption/caption (and not just data/dates). – hakre Jun 28 '12 at 14:22
  • @hakre I added more info. But pretty much I am having trouble setting the options to have it graph dates. I am looking at this doc, but it doesn't break it down by month date and year, just month - http://wiki.pchart.net/doc.dataset.setaxisdisplay.html – Dan Jun 28 '12 at 14:52
  • Wow give it some time. I mean, I don't expect you to read, type and understand all the examples given within minutes. Take yourself some time to do the examples as tutorials, e.g. type them and try what you typed (do not copy and paste). – hakre Jun 28 '12 at 15:57
  • I have given it some time a couple of days in fact. I understand it's not copy paste. I have been looking for an example that uses dates. – Dan Jun 28 '12 at 16:00
  • 1
    Please see this: [How to convert date to timestamp in PHP?](http://stackoverflow.com/questions/113829/how-to-convert-date-to-timestamp-in-php) - I suggest you just convert the X values. If they are within an array, you can try: `$xValues = array_map('strtotime', $xValues);`, if you get the dates from a database, you can also get it from the database as timestamp already (All roads lead to Rome). – hakre Jun 28 '12 at 16:01
  • @hakre Thanks for showing me the array_map function. I am doing that but I cannot draw that on pcharts. I will update later with my code that I am tyring. – Dan Jul 04 '12 at 16:48

0 Answers0