Chartjs-How can we use function of one component into another js file

0👍

I think you forgot to return value in speedDataGraph method that reason you not get value of graph data. so please return data then you can access in char.js file.

I hope you are understand my concept

0👍

return value from helper function.

export const speedDataGraph=(data)=>{
  return data;
}

Also use {} braces to import your function as its not default exported function.

import {speedDataGraph} from 'views/Dashboard/Dashboard';

Leave a comment