Support » Plugin: Inline Google Spreadsheet Viewer » Axis Bug? (I Know, I Know…)

  • Resolved Sean

    (@designicu_org)


    I’m trying to set several charts to have similar axes so they can be compared on equal scales. I did see your note about checking in the Google Forums but there is no clear help to be had.

    Things I have tried include adding the following to the shortcode…

    chart_v_axis=”6″
    chart_v_axis=”minValue: 6″
    vAxis=”6″
    vAxis=”minValue: 6″

    These shortcode additions generally give me a “undefined is not an object (evaluating ‘b.count’)” error.

    Does this need to be done via JavaScript? Maybe with something like vAxis:{ minValue: 6} — but I don’t know where to shim that JS in — and it seems like the chart_v_axis shortcode addition *should* take care of this…

    I’m obviously not understanding something.

    Thank you,

    Sean

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Meitar

    (@meitar)

    What you’re missing is that the plugin will translate JSON in your shortcode attribute value to real JavaScript objects for you so that Google’s Charts API will receive what it expects to.

    So, not

    chart_v_axis="minValue: 6"
    

    because this attribute value is a space-separated list of strings (like normal HTML), but rather:

    chart_v_axis='{"minValue": 6}'
    

    because this is JSON syntax representing one JavaScript object with one member variable whose key is named minValue and whose value is the JavaScript Number with amount 6.

    All attributes whose values are “objects” should be written this way. This is described in the plugin’s FAQ as well, for your future reference.

    Sean

    (@designicu_org)

    This was so helpful. Thank you! I managed to get the page to set min and max values so all my charts are now using the same scale.

    I did/do see the FAQ entry that starts “Some configuration options call for an Object value”. I think I just needed a few more examples to flesh out that concept. JSON is scary to me, as it probably is to a lot of typical shortcode users.

    https://wordpress.org/plugins/inline-google-spreadsheet-viewer/other_notes/

    FYI, the link to Other Notes just below that par (where I was hoping to find some code examples to learn from) just goes back to https://wordpress.org/plugins/inline-google-spreadsheet-viewer/#other_notes which doesn’t exist.

    Thank you again for your help, and for making this fantastic plugin. I really appreciate the nudge in the right direction.

    Sean

    Plugin Author Meitar

    (@meitar)

    FYI, the link to Other Notes just below that par (where I was hoping to find some code examples to learn from) just goes back to https://wordpress.org/plugins/inline-google-spreadsheet-viewer/#other_notes which doesn’t exist.

    Yeah, this happened as a result of WordPress.org’s redesign a year or two(?) ago and I have neglected to fix it. 🙁

    This was so helpful. Thank you! […] I really appreciate the nudge in the right direction.

    Glad to hear it. FWIW, I am unlikely to offer help unless it’s clear to me that the requester is genuinely making an effort to learn and isn’t going to be a waste of my time (as is probably clear from many other threads in this forum), but if that criteria is met I am actually extremely happy to offer assistance because that’s what *actually* makes the world go ’round.

    Sean

    (@designicu_org)

    Yeah, figured it was something like that.

    I get it. Thankless work. I did struggle before reaching out!

    Have a great night.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Axis Bug? (I Know, I Know…)’ is closed to new replies.