WordPress.org

Ready to get started?Download WordPress

Forums

How to Show Google Chart Tools Chart on a WP page (7 posts)

  1. slobizman
    Member
    Posted 2 years ago #

    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.

  2. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

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

  3. slobizman
    Member
    Posted 2 years ago #

    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.

  4. Pioneer Valley Web Design
    Member
    Posted 2 years ago #

    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.

  5. slobizman
    Member
    Posted 2 years ago #

    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.

  6. cmuld3r
    Member
    Posted 2 years ago #

    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/

  7. slobizman
    Member
    Posted 2 years ago #

    Thanks cmuld3r, I'll check it out.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags