[Chartjs]-How can I arrange according to month using chart Js?

1👍

Okay I found it, I used sort method, and grabbed the id of it

 const list = res.data.sort((a, b) => {
      return a._id - b._id
    })
    list.map((item) =>
      setUserStats((prev) => [
        ...prev,
        { name: MONTHS[item._id - 1], 'Active User': item.total },
      ])

Leave a comment