Hello i am trying to make custom tooltips for my timeline.  As described 
here
https://developers.google.com/chart/interactive/docs/customizing_tooltip_content?hl=ru

But it is not working. Maybe  somebody can tell me what i am doing wrong?

<script type="text/javascript" 
src="https://www.gstatic.com/charts/loader.js";></script>

<script type="text/javascript">
  google.charts.load("current", {packages:["timeline"]});
  google.charts.setOnLoadCallback(drawChart);
  function drawChart() {

    var container = document.getElementById('example3.1');
    var chart = new google.visualization.Timeline(container);
    var dataTable = new google.visualization.DataTable();
    dataTable.addColumn({ type: 'string', id: 'As' });
    dataTable.addColumn({ type: 'string', id: 'Os' });
    dataTable.addColumn({ type: 'date', id: 'Start' });
    dataTable.addColumn({ type: 'date', id: 'End' });
    dataTable.addColumn({ type: 'string', role: 'tooltip' });
    
    dataTable.addRows([
      [ '1. A', ' ', new Date(2014, 3, 9, 5, 18,8), new Date(2023, 1, 21, 
7,45,0),'sdfsdf' ],
      [ '1. A', '  ', new Date(2023, 1, 21, 7,45,0), new Date(2031, 12, 3, 
10,11,52), 'sdfs' ],
      [ '2. B', '   ', new Date(2020, 3, 25, 5, 18,8), new Date(2020, 8, 
30, 7,45,0),'sssss' ],
      [ '2. B', '    ', new Date(2020, 8, 30, 7,45,0), new Date(2021, 2, 5, 
10,11,52), 'aaaaa' ],
      [ '3. C', '   ', new Date(2020, 4, 5, 5, 18,8), new Date(2020, 9, 11, 
7,45,0), 'sdfsdf'],
      [ '3. C', '    ', new Date(2020, 9, 11, 7,45,0), new Date(2021, 2, 
17, 10,11,52), 'qqqqqq' ],
      [ '4. D', '   ', new Date(2021, 1, 10, 5, 18,8), new Date(2021, 2, 3, 
7,45,0), 'sssssssss' ],
      [ '4. D', '    ', new Date(2021, 2, 3, 7,45,0), new Date(2021, 2, 27, 
10,11,52),'zzzzzzz' ]
      
    ]);

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

    chart.draw(dataTable, options);
  }
</script>

<div id="example3.1"></div>

-- 
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/97d4fec8-7bc7-451d-8a5a-57d2600ae111n%40googlegroups.com.

Reply via email to