Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Onclick with react-chart

Am using "react-chartjs-2" to show charts, and I would like to show a page "/element" when I click on one of my chart elements. So I am using this option :

const option = {
  responsive: true,
  maintainAspectRatio: false,
  onClick (element) {
    if (element && element[0]) {
      console.log(element[0]._index);
      history.push('/element');
    }
  }

}

So when I click on any element of the chart, It gives me the correct page, but few moment later it shows this error :

Uncaught TypeError: this.getDatasetMeta(...).controller is null
    updateHoverStyle Chart.js:10143
    handleEvent Chart.js:10241
    eventHandler Chart.js:10167
    listener Chart.js:10100
    <anonymous> Chart.js:7830
    addListener Chart.js:7535
    addEventListener Chart.js:7833
    bindEvents Chart.js:10104
    each Chart.js:2231
    bindEvents Chart.js:10103
    initialize Chart.js:9388
    construct Chart.js:9373
    Chart Chart.js:9311
    renderChart index.js:247
    componentDidMount index.js:52
    React 13
    Redux 2
    e (index):2494
    Redux 2
    onFulfilled middleware.js:23
    promise callback*./src/config/middleware.js/promiseMiddleware/</< middleware.js:34
    dispatch (index):3665
    bindActionCreator Redux
    componentWillMount Login.js:125
    React 21
    js index.js:43
    Webpack 6
Chart.js:10143

I have no idea why I am getting this error. Any help please ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!