lucid-ui
Version:
A UI component library from AppNexus.
46 lines • 1.12 kB
JavaScript
import React from 'react';
import createClass from 'create-react-class';
import { LineChart, chartConstants } from '../../../index';
var data = [{
x: new Date('2015-01-01T00:00:00-08:00'),
bananas: 2,
cherries: 8
}, {
x: new Date('2015-03-02T00:00:00-08:00'),
bananas: 2,
cherries: 5
}, {
x: new Date('2015-05-03T00:00:00-08:00'),
bananas: 3,
cherries: 5
}, {
x: new Date('2015-07-04T00:00:00-08:00'),
bananas: 5,
cherries: 6
}];
var style = {
paddingTop: '5rem'
};
export default createClass({
render: function render() {
return /*#__PURE__*/React.createElement("div", {
style: style
}, /*#__PURE__*/React.createElement(LineChart, {
data: data,
margin: {
right: 80
},
width: 800,
colorMap: {
bananas: chartConstants.COLOR_4,
cherries: chartConstants.COLOR_2
},
yAxisFields: ['bananas'],
yAxisTitle: "Number of Bananas",
yAxisTitleColor: chartConstants.COLOR_4,
y2AxisFields: ['cherries'],
y2AxisTitle: "Number of Cherries",
y2AxisTitleColor: chartConstants.COLOR_2
}));
}
});