React-chartjs-2: change the backgroundColor color to a gradient

Viewed 30

I'm using Chart.JS with React and want to change the background color to Gradient Background I know how to do it in vanilla js but I'm not sure how to do it in React

Chart

  const [graphData, setGraphData] = React.useState({
labels: dataa.map((time) => time.time),
datasets: [
  {
    label: "just for test",
    data: dataa.map((data) => data.percentage),
    
    // i want to use Gradiant background here

    backgroundColor: "rgb(184 188 23 / 75%)",
    borderColor: "black",
    tension: 0.4,
    fill: true,

    cubicInterpolationMode: "monotone",
  },
],

});

0 Answers
Related