Skip to content

Commit

Permalink
fix prevous dashboard button
Browse files Browse the repository at this point in the history
  • Loading branch information
Nguyen-Duc-Khai committed Dec 14, 2023
1 parent 34c0a58 commit ed070f3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions dashboard/src/components/Dashboard/Chart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,7 @@ function Chart() {
console.log(`Fetch... ${import.meta.env.VITE_API_URL}`);

let response = await Axios.get(
`analytics?type=${pollutantType}&from=${queryDate.from}&to=${
queryDate.to
}`
`analytics?type=${pollutantType}&from=${queryDate.from}&to=${queryDate.to}`
);

const labels = response.data.map((x) => {
Expand Down Expand Up @@ -338,7 +336,7 @@ function Chart() {
</div>

<div className="buttons">
<button onClick={() => setPage(page - 1)} disabled={page === 0}>
<button onClick={() => setPage(page - 1)} disabled={page === 1}>
Previous
</button>

Expand All @@ -362,7 +360,7 @@ function Chart() {
</div>

<div className="chart-container">
<Line data={data} options={options} height="100px"/>
<Line data={data} options={options} height="100px" />
</div>
</div>
</>
Expand Down

0 comments on commit ed070f3

Please sign in to comment.