vertical reference line in google timeline visualization

后端 未结 5 570
Happy的楠姐
Happy的楠姐 2020-11-28 13:58

Hi I am using google visualization api to draw a timeline chart in my website. It works just fine. But there is one little thing that is bothering me. I want to display a ve

5条回答
  •  星月不相逢
    2020-11-28 14:26

    Create a first task to represent current date:

          dataTable.addRows([
    ['', 'Hoy', new Date(2014,9,2), new Date(2014,9,2) ],
    

    Create a function with jQuery to make this task longer:

    function MarcarHoy (div, filas){
      $('#'+div+' text:contains("Hoy")').css('font-size','11px').attr('fill','#A6373C').prev().first().attr('height',filas*41+'px').attr('width','1px').attr('y','0');
      }
    

    Call the function:

        chart.draw(dataTable, options);
      MarcarHoy('example1',23);
      google.visualization.events.addListener(chart, 'onmouseover', function(obj) {
        MarcarHoy('example1');
        });
    }
    

    The result:

    enter image description here

    Source: Viviendo en la Era de la Web 2.0

提交回复
热议问题