How to change tooltip text for google chart api?

后端 未结 2 1729
后悔当初
后悔当初 2020-12-15 17:52

http://code.google.com/apis/chart/




        
2条回答
  •  没有蜡笔的小新
    2020-12-15 18:16

    @Adam; If you want to edit text then check this http://code.google.com/apis/ajax/playground/?type=visualization#pie_chart

    you can change your code from here

    function drawVisualization() {
      // Create and populate the data table.
      var data = new google.visualization.DataTable();
      data.addColumn('string', 'Task');
      data.addColumn('number', 'Hours per Day');
      data.addRows(5);
      data.setValue(0, 0, 'Work');
      data.setValue(0, 1, 11);
      data.setValue(1, 0, 'Eat');
      data.setValue(1, 1, 2);
      data.setValue(2, 0, 'Commute');
      data.setValue(2, 1, 2);
      data.setValue(3, 0, 'Watch TV');
      data.setValue(3, 1, 2);
      data.setValue(4, 0, 'Sleep');
      data.setValue(4, 1, 7);
    

    and if you want your custom tooltip you have to use javascript for these

    http://code.google.com/p/gvtooltip/

    http://informationandvisualization.de/blog/tooltips-google-chart-api

提交回复
热议问题