creativetimofficial / argon-dashboard

Argon - Dashboard for Bootstrap 5 by Creative Tim
https://www.creative-tim.com/product/argon-dashboard
MIT License
674 stars 1.26k forks source link

Chart Css changed if I refresh page. See the below images. #66

Closed bilaliqbal1 closed 3 years ago

bilaliqbal1 commented 3 years ago

https://www.creative-tim.com/new-issue/argon-dashboard

I am using react chart.js and I have almost completed you can check below image.

image

but the issue is Whenever I refresh that page it will show different CSS like below image.

image

`const SocialCampaign = () => {

const [stage, setStage] = useState("");

const Chart = () => {

let labels = [];
let data = [];

axios({
  method: "get",
  url: SocialLeads,
  // data: Body,
})
  .then((res) => {
    const res1 = res.data.response;
    // console.log(res.data.response);
    // setStage(res.data.response);
    res1.forEach(element => {
      //   console.log(element);
      labels.push(element.campaign_name);
      data.push(element.totalleads);
    });
    // console.log(labels, data);
    setStage({
      labels: labels,
      datasets: [{
        label: "Campaign",
        data: data,
        backgroundColor: [
          'blue',
          '#fb6340',
          '#f5365c',
          'rgb(94, 82, 228)',
          'rgb(255, 205, 86)',
          'rgb(255, 99, 132)',
        ],
      }]
    });
  })
  .catch(err => {
    console.log(err);
  })

} useEffect(() => { Chart(); }, [true]) return (

{Object.keys(stage).length && }

`

github-actions[bot] commented 3 years ago

@bilaliqbal1 this issue was automatically closed because it did not follow the bellow rules:


IMPORTANT: Please use the following link to create a new issue:

https://www.creative-tim.com/new-issue/argon-dashboard

**If your issue was not created using the app above, it will be closed immediately.**

Love Creative Tim? Do you need Angular, React, Vuejs or HTML? You can visit:
👉  https://www.creative-tim.com/bundles
👉  https://www.creative-tim.com