Support » Fixing WordPress » How to Show Google Chart Tools Chart on a WP page

  • slobizman

    (@slobizman)


    Google Chart Tools is an incredible way to show beautiful interactive charts on a website. I really want to use some in a WordPress site, but it turns out to be nearly impossible, at least in an easy way. You’d think you could just place the javascript code into a wordpress page and have it display, but no, you cannot. Here is the extent to which one wordpress guy went to to try and do it. I tried a WP plugin that lets you place javascript on a page, but that didn’t work.

    Does anyone know, or have any idea, of how to do this? I’d be willing to pay for a plugin if there was one for this too.

    It’s just a shame that such a wonderful tool can’t be run in a WordPress site.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Pioneer Web Design

    (@swansonphotos)

    Use a Page Template (in a Child Theme is best) to include PHP or script functionality in WordPress.

    slobizman

    (@slobizman)

    I just found a way to do it. I installed the Jinx plugin and it gives me a blog in the post/page page to insert the javascript. Then, I place the call to the chart in the post.

    For example, using the example on this Google Charts page, I place the following in the post body where I want it:

    <div id="chart_div"></div>

    Then I place all that javascript code you see above it into the plugin’s new post field.

    Works great!

    Another way is something I didn’t even know I had in Thesis — it has it’s own Javascript field that works just like the plugin one. I just had to show it from my Screen Options.

    Pioneer Web Design

    (@swansonphotos)

    The reason I would use a page template in a child theme is that the only page(s) the code would load at would be the ones using the page template, not all of them…but glad you worked this out.

    slobizman

    (@slobizman)

    I think that the plugin loads the code for only the page that the code is entered into. The plugin creates an input form on a per post/page basis and you enter it in there. I would assume it only loads the code when that page is requested.

    And I need to be able to do a ton of these on and as-needed basis, and page templates would be a lot of work.

    Appreciate the input! Thank you.

    Not sure if it will fulfill your requirements, but you can use the chart editor and easily embed HTML in post/page:
    http://imagecharteditor.appspot.com/

    Thanks cmuld3r, I’ll check it out.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to Show Google Chart Tools Chart on a WP page’ is closed to new replies.