Jump to content


Photo
- - - - -

Charts in php


Best Answer jbrouwer , 13 February 2013 - 01:21 PM

I figured it out. Thanks anyway.

Go to the full post


  • Please log in to reply
7 replies to this topic

#1 jbrouwer

jbrouwer

    Super Member

  • Members
  • 191 posts
  • Country: Country Flag

Posted 06 February 2013 - 01:50 PM

Hi,

 

Is it possible to use the charts shortcode in PHP? I would like to show charts of user generated data.

 

Thanks.



#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 06 February 2013 - 04:07 PM

To clarify, how do you intend on incorporating both? Like, adding the shortcode inside a PHP tag?



#3 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 06 February 2013 - 04:57 PM

Let me try and understand this, you want to execute a shortcode within PHP?

If so you can use the wp function do_shortcode() 

Please Login or Register to see this Hidden Content



#4 jbrouwer

jbrouwer

    Super Member

  • Members
  • 191 posts
  • Country: Country Flag

Posted 07 February 2013 - 11:37 AM

Sorry for the short explanation.

 

I would like to show a chart on each post using the data which is stored in the custom fields of that post. Every post has different data to show (user generated). Is there a way I can use the chart option Pagelines offers? What is the best way to do this with Pagelines?

 

I was trying to do this with Google charts API, but I was running into trouble to get server side data into a client side generated chart. This

Please Login or Register to see this Hidden Content

from Google is helpful, but I don't know how I can get custom fields (it needs the loop) using an ajax call.

 

Thanks



#5 Danny

Danny

    Is Awesome!

  • Moderators
  • 13192 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 07 February 2013 - 12:14 PM

If I am totally honest, I wouldn't really have any idea how to achieve this. However, I did do a search and found this plugin which uses custom fields apparently.

 

Please Login or Register to see this Hidden Content

 

If the plugin isn't for you, I would recommend contacting one of our Pros, who may be able to assist you -

Please Login or Register to see this Hidden Content



#6 jbrouwer

jbrouwer

    Super Member

  • Members
  • 191 posts
  • Country: Country Flag

Posted 13 February 2013 - 01:21 PM   Best Answer

I figured it out. Thanks anyway.



#7 Danny

Danny

    Is Awesome!

  • Moderators
  • 13192 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 13 February 2013 - 01:29 PM

How did you achieve this in the end ?



#8 jbrouwer

jbrouwer

    Super Member

  • Members
  • 191 posts
  • Country: Country Flag

Posted 15 February 2013 - 05:26 PM

I made a little plugin. It uses the wordpress buildin ajax functionality to get the metadata from the post and display it in a google chart. Let me know if you want to have the code.

 

Cheers.