The annotation placement is unfortunately buggy.  The only workaround I can
suggest at this time is to stack another series on your series with all
zero values, and do the annotations for that new series.

On Wed, Apr 29, 2020 at 3:21 PM Андрей Малютин <[email protected]>
wrote:

> Please, someone help me))
> How could i place the *annotation text* to the bottom of the bar, if the
> value is *negative*?
>
> *Exemple:* https://jsfiddle.net/1ehqfkv9/
>
> *Code:*
> <script type="text/javascript" src="
> https://www.gstatic.com/charts/loader.js";></script>
>        <div id="columnchart_values" style="width: 500px; height:
> 300px;"></div>
> <script type="text/javascript">
>     google.charts.load("current", {packages:['corechart']});
>     google.charts.setOnLoadCallback(drawChart);
>     function drawChart() {
>       var data = google.visualization.arrayToDataTable([
>         ["Element", "Density", { role: "style" } ],
>         ["Copper", 8.94, "#b87333"],
>         ["Silver", -10.49, "silver"],
>         ["Gold", 19.30, "gold"],
>         ["Platinum", 21.45, "color: #e5e4e2"]
>       ]);
>
>       var view = new google.visualization.DataView(data);
>       view.setColumns([0, 1,
>                        { calc: "stringify",
>                          sourceColumn: 1,
>                          type: "string",
>                          role: "annotation" },
>                        2]);
>
>       var options = {
>         title: "Density of Precious Metals, in g/cm^3",
>         width: 600,
>         height: 400,
>         bar: {groupWidth: "95%"},
>         legend: { position: "none" },
>
>       };
>       var chart = new
> google.visualization.ColumnChart(document.getElementById("columnchart_values"));
>       chart.draw(view, options);
>   }
> </script>
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-visualization-api/0d579019-2556-4d91-b893-1fecf53fa6db%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/0d579019-2556-4d91-b893-1fecf53fa6db%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
[email protected] <[email protected]>   Cambridge MA

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJN8iEZ0xPz8ha1ij%2BhCHhYxEp5p0Wj4HrEG%3DB80M8hh1Q%40mail.gmail.com.

Reply via email to