JianWei-0510 / gitpost

使用 Github REST API 串接,將此專案的 issues 作為文章
https://gitpost.up.railway.app
0 stars 0 forks source link

Exploring Weather Data with JavaScript #11

Open JianWei-0510 opened 8 months ago

JianWei-0510 commented 8 months ago

In this post, we'll use JavaScript to create an interactive line chart that visualizes historical weather data for Kaohsiung City.

Code:


// Load data from a CSV file
const data = Papa.parse("weather.csv").data;

// Define chart options
const options = {
  chart: {
    type: 'line'
  },
  series: [{
    data: data.map(row => [row.Date, row.Temperature])
  }]
};

// Create the chart
const chart = Highcharts.chart('chart-container', options);