diff --git a/examples/legend/App.js b/examples/legend/App.js index bd84fbc..54c99cc 100644 --- a/examples/legend/App.js +++ b/examples/legend/App.js @@ -5,11 +5,21 @@ import ReactDOM from 'react-dom'; import { Legend, PieChart, - ScatterplotChart + ScatterplotChart, + LineChart, + AreaChart, + BarChart } from 'react-easy-chart'; import { escapeHTML } from '../util'; import Scrollspy from 'react-scrollspy'; +const lineColors = [ + { color: '#3F4C55' }, + { color: '#E3A51A' }, + { color: '#F4E956' }, + { color: '#AAAC84' } +]; + const pieData = [ { key: 'Cats', value: 100 }, { key: 'Dogs', value: 200 }, @@ -50,6 +60,7 @@ const scatterStyle = { } }; + const bigData = [ { type: 'One', @@ -128,6 +139,35 @@ const bigData = [ } ]; +const lineData = [ + [ + { x: 'Mon', y: 20 }, + { x: 'Tue', y: 10 }, + { x: 'Wed', y: 33 }, + { x: 'Thu', y: 45 }, + { x: 'Fri', y: 15 } + ], [ + { x: 'Mon', y: 10 }, + { x: 'Tue', y: 15 }, + { x: 'Wed', y: 13 }, + { x: 'Thu', y: 15 }, + { x: 'Fri', y: 10 } + ], + [ + { x: 'Mon', y: 5 }, + { x: 'Tue', y: 40 }, + { x: 'Wed', y: 33 }, + { x: 'Thu', y: 12 }, + { x: 'Fri', y: 8 } + ] +]; + +const barData = [ + { x: 'Cats', y: 20 }, + { x: 'Dogs', y: 10 }, + { x: 'Other', y: 25 } +]; + export default class LegendContainer extends PureComponent { constructor(props) { @@ -179,6 +219,8 @@ export default class LegendContainer extends PureComponent {
  • Config
  • Styles
  • Scatterplot
  • +
  • Line and area charts
  • +
  • Bar charts
  • @@ -431,6 +473,124 @@ export default class LegendContainer extends PureComponent { /> + + +
    +

    Line and area charts

    +

    Line and area charts example

    +
    +            {(() => {
    +              const html = (`
    +                
    +
    +                
    +
    +                `);
    +              return (
    +                
    +              );
    +            })()}
    +            
    + +
    + +
    +
    + +
    +
    + +
    + + +
    + + +
    +

    Bar charts

    +

    Bar charts example

    +
    +            {(() => {
    +              const html = (`
    +                
    +
    +                `);
    +              return (
    +                
    +              );
    +            })()}
    +            
    + + + + + + +
    );