Support » Plugin: Inline Google Spreadsheet Viewer » Inline Google Spreadsheet viewer will not let me customize it

Viewing 1 replies (of 1 total)
  • Plugin Author Meitar

    (@meitar)

    Hi. 🙂 So, there are a few different reasons this isn’t currently working, so I’ll go over each of the things you need to fix one at a time. However, I want to start by mentioning that rather than starting a new thread, if you feel you have additional questions after receiving a reply here, you should simply post another reply. New threads about the same topic make the history of a discussion hard to find, which can lead to confusion.

    I’m writing this reply assuming this is a continuation of this other, prior thread.

    The first issue with your shortcode is actually not with the shortcode, but rather your spreadsheet’s sharing settings in Google Drive. Yours is a “new” Google Sheet (distinct from the “old” Google Sheets). You can tell it’s new because the spreadsheet URL looks like google.com/spreadsheets/d/KEY/ instead of the way old URLs look (which is like spreadsheets.google.com/pub?key=KEY). What this means is that to make your spreadsheet work with Inline Google Spreadsheet Viewer, you must set the Google Sheet’s sharing settings to “Anyone with the link.”

    Currently, your spreadsheet is not shared the way it needs to be. You can tell this is the case because, after you log out of your Google Account, you can no longer access the spreadsheet’s editing URL:

    https://docs.google.com/spreadsheets/d/1brxjeTjMgr93l_23crL2W1jO6pGCqR2CcabRm9DTOSg/edit

    Notice how you get a “You need permission” page when you try accessing that link while you’re signed out of your Google Account? That means the plugin won’t be able to see your spreadsheet. Another way to think about this is that the plugin is an anonymous user. It doesn’t use the same access credentials as your Google Account. It doesn’t use access credentials at all, which is why you need to make sure your spreadsheet is shared “publicly.”

    Follow these instructions from Google to change your spreadsheet’s sharing settings.

    Once your spreadsheet is shared correctly, you can see that signing out of your Google Account and following the first link, the one to the spreadsheet, you’ll be able to view the the spreadsheet. No “You need permission” message anymore.

    At this point, you can use the first part of your shortcode, like this…

    [gdoc key="https://docs.google.com/spreadsheets/d/1brxjeTjMgr93l_23crL2W1jO6pGCqR2CcabRm9DTOSg/pubhtml"]

    …to verify that the plugin is actually loading the correct spreadsheet. The above steps are what the FAQ means when it says:

    Nothing appears where my chart should be.

    The best way to determine what’s wrong with a chart that isn’t displaying properly is to try displaying the chart’s data as a simple HTML table (by removing the chart attribute from your shortcode), and seeing what the tabular data source looks like.

    To make a table into a chart, you already had the right idea:

    [gdoc key="https://docs.google.com/spreadsheets/d/1brxjeTjMgr93l_23crL2W1jO6pGCqR2CcabRm9DTOSg/pubhtml" chart="line"]

    If your spreadsheet has the right number of rows and columns to make a line chart (see Google’s documentation here for more info on the data format for line charts), then this will display a line chart with the default options.

    From here, you can add additional attributes to customize the look and feel of the chart. You have the right idea with the rest of the shortcodes, but you need to be a bit more careful when you write them:

    • You wrote: chart_point_size ="15px", but notice the accidental space before the equals sign. Try chart_point_size="15px" (no space) instead.
    • You wrote style="height: 260px width: 80px". The style attribute accepts a CSS rule, but this CSS rule is invalid because it’s missing the separator. Try style="height: 260px; width: 80px" (notice the additional semicolon separating the value of height with the start of the width declaration).
    • Finally, you wrote: chart-colors="red blue", but note that there is no such attribute named chart-colors, only chart_colors, with an underscore, not a dash. So try chart_colors="red blue" instead.

    Putting it all together, once you have corrected the sharing setting for your Google Sheet as described above, try this shortcode:

    [gdoc key="https://docs.google.com/spreadsheets/d/1brxjeTjMgr93l_23crL2W1jO6pGCqR2CcabRm9DTOSg/pubhtml" chart="line" chart_point_size="15px" style="height: 260px; width: 80px" chart_colors="red blue" title="Growth of the UK economy and UK national debt shown from 2009 to 2014"]

    Good luck. 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Inline Google Spreadsheet viewer will not let me customize it’ is closed to new replies.