jeudi 22 octobre 2015

Highcharts checkbox

I have a chart in my rails app and here is my code for show/hide y axes which works perfectly now.

var yVis = false,
    xVis = true;
$('#showY').click(function () {
    <%-y_axis.each do |axis|%>
    $('#report-box').highcharts().yAxis[<%=y_axis.index(axis)%>].update({
        labels: {
          enabled: <%=axis.has_key?(:enabled) ? axis[:enabled] : false %>
        },
        title: {
          text: '<%=axis[:title]%>'
        }
    });
    <%end%> 
});

How do I change it for updating my chart with

labels: {
  enabled: false
},
title: {
  text: null
}

when a checkbox is not checked?




Aucun commentaire:

Enregistrer un commentaire