How to get rid of negative numbers in vAxes

28 views
Skip to first unread message

Desmond Henaghen

unread,
Nov 4, 2016, 6:49:06 AM11/4/16
to Google Visualization API
Hi,

I am currently trying to create a stacked combo line/barchart with data shown above and below the horizontal axis. My problem right now is that my data underneath the axis is represented as negative numbers to get the shape from the graph, but the actual data being charted should be positive. Is there a way using vAxes.format to get rid of the negative formatting and have both negative and positive scales looking identical?

Currently I have tried things like this:
vAxes: {
    0: {
        title:'Price',
        format: "€#.##;€#.##"
    },
    1: {
        title:'Orders',
        format: "#;#"
    }
}
but to no avail. I have also tried using NumberFormatter but again have had no luck.

Do any of you know of a way I could achieve this?

Many Thanks!

Daniel LaLiberte

unread,
Nov 4, 2016, 12:51:48 PM11/4/16
to Google Visualization API
Hi Desmond,

You can't do what you want with formatting, at least not yet, but you can specify a list of tick values and a formatted representation of each.  You would specify something like this:

  vAxis: { ticks: [{v:-10, f:'10'}, {v:0, f:''}, {v:10, f: '10'}] }

You can specify each data value in your datatable in a similar way, so it shows up in tooltips as you would like.


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/ac8d5c75-636e-4e7e-bbbe-dbc50d36e29e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages