Yes, you can do both. For the first, give the first data set negative
values, but use a
NumberFormatter<https://developers.google.com/chart/interactive/docs/reference#numberformatter>to
strip the minus sign; for the second, use the same ICU pattern as the
hAxis.format option:
// create a format, then format the second and third columns and the hAxis
// the pattern is split into two subpatterns (';' is the separator):
// the first is the positive numbers, the second is negative numbers
// use the same pattern for both to make them appear the same (ie,
without a minus sign)
var pattern = '#,###;#,###';
var formatter = new google.visualization.NumberFormat({pattern: pattern});
formatter.format(data, 1);
formatter.format(data, 2);
chart.draw(data, {
hAxis: {
format: pattern
}
});
On Tuesday, June 19, 2012 6:08:04 AM UTC-4, Rossco P wrote:
>
> Hi All,
>
> Is there a way to recreate the following highcharts chart using Google
> Charts?
>
> http://www.highcharts.com/demo/bar-negative-stack
>
> Also does anyone know how to change the legend for a mirrored chart to be
> positive on both sides of the axis i.e. negatives displayed as positive.
>
> All help much appreciated,
> Ross.
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/qKAlEN7O1BEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.