← 返回 snapchat 的题目列表React Data Fetch and Graph Display
类型:online_judge
Build a React application that fetches data from a given API and displays the data in a graph.
The provided API returns a JSON list containing time and corresponding data.
Use the fetch function to request the API and retrieve data.
Use a chart library (e.g., Chart.js) to plot a graph of data changes over time.
Ensure the UI is responsive and adaptive.
Provide a reload button to fetch the data again.
Assume the API URL is https://example.com/api/data, and the returned data format is:
[
{ "time": "2023-01-01T00:00:00Z", "value": 100 },
{ "time": "2023-01-01T01:00:00Z", "value": 150 }
]