heron2014 / weather-redux-app

Weather app build in React and Redux
0 stars 0 forks source link

chart library for react - react sparkline #9

Open heron2014 opened 8 years ago

heron2014 commented 8 years ago

docs npm install --save react-sparklines

usage:

import React from 'react';
import { Sparklines, SparklinesLine } from 'react-sparklines';
...
<Sparklines data={[5, 10, 5, 20]}> //expect an array of numbers
  <SparklinesLine color="blue" />
</Sparklines>

our data : weather is:

weather : [
  city:{...},
  list: [
    {main: {temp: 260, humidity: 44, presure: 77}}
     {main: {temp: 250, humidity: 34, presure: 77}}
     {main: {temp: 220, humidity: 24, presure: 77}}
  ]
]

We need temp: [260, 250, 220]