Show value of Google column chart

后端 未结 1 1434
青春惊慌失措
青春惊慌失措 2021-01-03 11:08

I have a column chart using Google Visualization.

Right now, in order for me to see each value, I have to hover on each graph to see the value. Example,

相关标签:
1条回答
  • 2021-01-03 11:56

    You should look into annotations.

    The column chart documentation has a cover of it here.

    Either you add annotation columns to your DataTable, annotation for column 1 should be at the index right after, or you can create a view and stringify the source column.

    view.setColumns([0, //The "descr column"
    1, //Downlink column
    {
        calc: "stringify",
        sourceColumn: 1, // Create an annotation column with source column "1"
        type: "string",
        role: "annotation"
    }]);
    

    The annotation is as standard for column charts placed at the top inside of the column.

    Here is my play-around-fiddle

    0 讨论(0)
提交回复
热议问题