Skip to content

Option OnClick event #79

@g-trema

Description

@g-trema

Hi!
Thank you for this laravel package!

I have a chart built with an onClick option like this one:

onClick:function(c,i){
  e = i[0];
  var id = this.data.labels[e._index];
  var page = "index.php?product=" +id;
  document.location.href=page;
}

How can I pass this option through the controller ?
I tried some things, but nothing works.

Thank you for your help!

Edit:
Same question with the tooltips option:

tooltips: {
   callbacks: {
       label: function(item, data) {
              var label = data.datasets[item.datasetIndex].label;
              var value = data.datasets[item.datasetIndex].data[item.index];
              if (value === 0.08) {
                     value = 0;
              }

               return label + ': ' + value;
              }
       }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions