Legend of C3.js

1

I would like to know if it is possible to give events to a legend created by myself so that these events act on the graph, in the same way that the C3 legend of the graph acts.

Currently the code I have is the following:

$('#datos_grafica_windSpeed .datos_grafica_combo').on('mouseover',function(){
    if($(this).children('span').children('strong').html()!='0'){
        //chart_windSpeed.revert();
        chart_windSpeed.focus($(this).attr('id'));
        $(this).css('color','#444');
        $(this).css('text-shadow','#bbb 1px 1px');
    }
});
$('#datos_grafica_windSpeed .datos_grafica_combo').on('mouseout',function(){
    chart_windSpeed.revert();
    $(this).css('color','#5e5e5e');
    $(this).css('text-shadow','none');
});

$('#datos_grafica_windSpeed .datos_grafica_combo').on('click', function (id) {
    chart_windSpeed.toggle($(this).attr('id'));
});

The functionality of hiding the line of the graph works when you click on the legend, but the event of when you put the mouse over and the line is highlighted does not work.

I also add the JSP.

<div class="contenido_grafica_forecast">    
  <span class="cont_datos_grafica_forecast" id="datos_grafica_windSpeed">
  <span id="ws_forecast1_graf1" class="datos_grafica_combo">
  <span class="datos_cian"></span>
  <spring:message code="text.forecast"/>1</span>
  <span id="ws_forecast2_graf1" class="datos_grafica_combo">
     <span class="datos_oliva">
  </span>
  <spring:message code="text.forecast"/>2</span>
  <span id="ws_forecast3_graf1" class="datos_grafica_combo">
  <span class="datos_amarillo"></span>
  <spring:message code="text.forecast"/>3   </span>
 </span>                                    
</div>
    
asked by ApalanKing 27.03.2018 в 08:47
source

0 answers