• Resolved ZenEntSEA

    (@zenentsea)


    I am trying to customize a line chart. I would like to have ticks at 9, 18 & 27. But when I use this code
    chart_v_axis='{"ticks":"9,18,27", "gridlines": {"color": "#202020"}}'
    I get ticks on 1, 2, 7, 8 & 9. The gridlines color code works fine.

    Could you tell me what syntax I can use to make sure its not ignoring the commas? Am I missing something obvious?

    https://www.ads-software.com/plugins/inline-google-spreadsheet-viewer/

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

    (@meitar)

    ticks should be an array, not a string. Read the friendly manual.

    Thread Starter ZenEntSEA

    (@zenentsea)

    I see that for an array, it should look like this (from the page you referenced):

    vAxis: { ticks: [5,10,15,20] }

    But when I attempt to use [ or ], I get an error. SHould I different character be substituted for the shortcode, like = instead of :?

    Plugin Author Meitar

    (@meitar)

    URL encode the [ and ] characters. Read this plugin’s FAQ.

    Thread Starter ZenEntSEA

    (@zenentsea)

    Read the FAQ, found the URL encode equivalents. Still not quite sure how to incorporate that into your shortcode:

    chart_v_axis='{"ticks": %5B 9,18,27 %5D, "gridlines": {"color": "#202020"}}'

    Still gives error.

    Plugin Author Meitar

    (@meitar)

    Right above the button you pressed to post this message, this forum asks you:

    Did you include a link to your site, so that others can see the problem?

    Other things that would be helpful:

    • The shortcode you’re using.
    • Literally any info about the error you say you’re getting.
    Thread Starter ZenEntSEA

    (@zenentsea)

    Shortcode:

    [gdoc key="https://docs.google.com/spreadsheets/d/1hOJPFL9VrwBYYn0OKeVwI2MwgxPX0lyzpx0bpIBarHw/edit#gid=1314876059" chart="Line" chart_chart_area='{"width":"90%", "height":"75%"}' chart_background_color='{"fill":"#292929"}' chart_v_axis='{"ticks": %5B 5,10,15,20 %5B "gridlines": {"color": "#202020"}}' chart_h_axis='{"textPosition":"bottom", "textStyle": {"color": "#CBCBCB", "fontSize": "10"}}' chart_legend='{"position": "top", "maxLines": "3", "alignment": "center", "textStyle": {"color": "#CBCBCB", "fontSize": "10"}}' chart_height="500" chart_width="100%"]

    Site/page is not live.

    Error appears on page where chart should be. Red box stat states “b is undefined”.

    Plugin Author Meitar

    (@meitar)

    Google Docs can’t load your Sheet. Screenshot. I’d worry about fixing that issue first. Good luck.

    Plugin Author Meitar

    (@meitar)

    Also,

    chart_v_axis='{"ticks": %5B 5,10,15,20 %5B "gridlines": {"color": "#202020"}}'

    has at least two syntax errors in it:

    1. %5B ([) is used to open and close the array, but you actually mean %5D (]) to close it.
    2. You’re missing a comma after the close of the array and before "gridlines", since that’s the next element.

    In short, please provide a usable (minimal) test case of where chart_v_axis fails. I really don’t have the time to troubleshoot syntax errors and point you at the FAQ/manual every time you have a problem. Thanks.

    Thread Starter ZenEntSEA

    (@zenentsea)

    Well that’s strange because I can get to the Google Doc just fine, Its ‘view only’ in this screenshot I took after logging out. I also have checked from multiple computers/browsers, not logged into google, and its there too. Also the page I’m testing this on has a couple tables from the same spreadsheet all displaying fine, using their own shortcode with this same gdoc.

    Here is the new shortcode after your suggestions, still not working:

    [gdoc key="https://docs.google.com/spreadsheets/d/1hOJPFL9VrwBYYn0OKeVwI2MwgxPX0lyzpx0bpIBarHw/edit#gid=1314876059" chart="Line" chart_chart_area='{"width":"90%", "height":"75%"}' chart_background_color='{"fill":"#292929"}' chart_v_axis='{"ticks":%5B 9,18,27%5D, "gridlines": {"color": "#202020"}}' chart_h_axis='{"textPosition":"bottom", "textStyle": {"color": "#CBCBCB", "fontSize": "10"}}' chart_legend='{"position": "top", "maxLines": "3", "alignment": "center", "textStyle": {"color": "#CBCBCB", "fontSize": "10"}}' chart_height="500" chart_width="100%"]

    Here is a test page outside our pay wall that I copied the shortcode into so you can see the error.

    I appreciate your help.

    Thread Starter ZenEntSEA

    (@zenentsea)

    Nothing huh?

    Plugin Author Meitar

    (@meitar)

    Nothing huh?

    I haven’t looked at your test page yet. You’re not the highest priority in my life right now. And bluntly, I don’t like being haughtily prodded, so I think I’ll ignore this for a while longer.

    Thread Starter ZenEntSEA

    (@zenentsea)

    1. I realize I’m not your “highest priority”, I never claimed to be, or insinuated that…. or even asked for that.

    2. I only “prodded” because your previous replies were so quick, combined with you marking this support thread as ‘resolved’, led me to believe this was not on your radar any longer, but my errors persist.

    3. “I think I’ll ignore this for a while longer.” Have I done anything to upset you? If so, I apologize, but I feel I’ve been nothing but thankful of your help, and making the changes you suggest.

    Again….. I appreciate your help.

    Plugin Author Meitar

    (@meitar)

    Have I done anything to upset you? If so, I apologize, but I feel I’ve been nothing but thankful of your help, and making the changes you suggest.

    Perhaps I attributed some entitled malice in your prod that you did not intend. Chalk it up to Capitalism Should Die But Won’t. *shrug* Anyways, thanks for the test case, will take a peek when I get a chance.

    Thread Starter ZenEntSEA

    (@zenentsea)

    No entitled malice, or haughtiness intended. Sorry if it came across that way. Looking forward to your thoughts on my issue when you can get to it.

    Yuffx

    (@yuffx)

    Hi,I took your code and modified this line chart_v_axis='{“ticks”:”%5B 9,18,27%5D”, “gridlines”: {“color”: “#202020”}}’
    I added %5B 9,18,27%5D between “”. I’m not sure if this is the right way but it seems to work ??

    Cheers!

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Chart v_axis syntax’ is closed to new replies.