Customized tooltip does not work?

261 views
Skip to first unread message

Evgueni Gordienko

unread,
Feb 18, 2014, 3:42:40 PM2/18/14
to google-visua...@googlegroups.com

The example below does not work - any hint what is wrong?

Thanks,
Eugene

<html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
    google.load('visualization', '1', {'packages' : ['columnchart']});
    google.setOnLoadCallback(drawChart);

    function drawChart() {
      var dataTable = new google.visualization.DataTable();
      dataTable.addColumn('string', 'Year');
      dataTable.addColumn('number', 'Sales');
      // A column for custom tooltip content
      dataTable.addColumn({type: 'string', role: 'tooltip'});
      dataTable.addRows([
        ['2010', 600, '$600K in our first year!'],
        ['2011', 1500, 'Sunspot activity made this our best year ever!'],
        ['2012', 800, '$800K in 2012.'],
        ['2013', 1000, '$1M in sales last year.']
      ]);

      var options = { legend: 'none' };
      var chart = new google.visualization.ColumnChart(document.getElementById('traceChart'));
      chart.draw(dataTable, options);
    }
    </script>
  </head>
  <body style="font-family: Arial;border: 0 none;">
    <div id="traceChart" style="width: 1200px; height: 800px;"></div>
  </body>
</html>

Sergey Grabkovsky

unread,
Feb 18, 2014, 3:59:05 PM2/18/14
to google-visua...@googlegroups.com
Hello, the columnchart package is extremely outdated and deprecated. Use the newer corechart package to get the new charts and features. An added bonus is that you only have to load the corechart package to get ColumnChart, BarChart, LineChart, PieChart, CandlestickChart, BubbleChart, and ScatterChart.

- Sergey


--
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-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Evgueni Gordienko

unread,
Feb 18, 2014, 4:23:16 PM2/18/14
to google-visua...@googlegroups.com
Thanks!

Will try CoreChart.

Is time line chart supported for custom tooltips?


--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/FdeRaMUDfmQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

Evgueni Gordienko

unread,
Feb 18, 2014, 5:01:29 PM2/18/14
to google-visua...@googlegroups.com
Thanks a lot - it works with corechart:


<html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
    google.load('visualization', '1', {'packages' : ['corechart']});

   
    google.setOnLoadCallback(drawChart);

    function drawChart() {
      var dataTable = new google.visualization.DataTable();
      dataTable.addColumn('string', 'Year');
      dataTable.addColumn('number', 'Sales');
      // A column for custom tooltip content
      dataTable.addColumn({type: 'string', role: 'tooltip'});
      dataTable.addRows([
        ['2010', 600, '$600K in our first year!'],
        ['2011', 1500, 'Sunspot activity made this our best year ever!'],
        ['2012', 800, '$800K in 2012.'],
        ['2013', 1000, '$1M in sales last year.']
      ]);

      var options = { legend: 'none',
              tooltip: {isHtml: true},

Sergey Grabkovsky

unread,
Feb 18, 2014, 5:31:11 PM2/18/14
to google-visua...@googlegroups.com
No, custom tooltips are currently not supported in the Timeline visualization.

- Sergey


Jon Orwant

unread,
Feb 18, 2014, 5:35:01 PM2/18/14
to google-visua...@googlegroups.com
Elaborating on what Sergey said, we expect to have custom tooltips for Timelines in a future Charts release, but aren't sure which yet.

Jon

Evgueni Gordienko

unread,
Feb 18, 2014, 6:06:07 PM2/18/14
to google-visua...@googlegroups.com
Any way to disable tooltips in timeline chart now?

Thanks,
Eugene


You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/FdeRaMUDfmQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

Jon Orwant

unread,
Feb 19, 2014, 9:03:38 AM2/19/14
to google-visua...@googlegroups.com
tooltip: { trigger: 'none' } will work in the future, but not yet.  The timeline is still new and we haven't added most of of the regular Google Charts features to it yet.

Jon

Jon Orwant

unread,
Feb 19, 2014, 10:51:26 AM2/19/14
to google-visua...@googlegroups.com
Update: the ability to turn off timeline tooltips will be in the next release of Google Charts, which should be in March.  

Jon

Evgueni Gordienko

unread,
Feb 19, 2014, 1:28:04 PM2/19/14
to google-visua...@googlegroups.com
Thanks a lot - will wait.
The workaround then would be to turn off tooltips and add my own listener on 'select' or 'mouseover' event with
popup showing what I need.
Reply all
Reply to author
Forward
0 new messages