lucid-ui
Version:
A UI component library from AppNexus.
53 lines • 2.27 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
var create_react_class_1 = __importDefault(require("create-react-class"));
var index_1 = require("../../../index");
var data = [
{
date: new Date('2015-01-01T00:00:00-08:00'),
blueberries: 2000,
oranges: 3000,
},
{
date: new Date('2015-01-02T00:00:00-08:00'),
blueberries: 2000,
oranges: 5000,
},
{
date: new Date('2015-01-03T00:00:00-08:00'),
blueberries: 3000,
oranges: 2000,
},
{ date: new Date('2015-01-04T00:00:00-08:00'), blueberries: 5000 },
{
date: new Date('2015-01-05T00:00:00-08:00'),
blueberries: 2500,
oranges: 6300,
},
{
date: new Date('2015-01-06T00:00:00-08:00'),
blueberries: 1500,
oranges: 6100,
},
];
var yFormatter = function (d) { return d / 1000 + "k"; };
var xFormatter = function (d) { return d.getMonth() + 1 + "-" + d.getDate(); };
var style = {
paddingTop: '5rem',
};
exports.default = create_react_class_1.default({
render: function () {
return (react_1.default.createElement("div", { style: style },
react_1.default.createElement(index_1.LineChart, { margin: {
right: 80,
}, width: 800, data: data, colorMap: {
blueberries: index_1.chartConstants.COLOR_0,
oranges: index_1.chartConstants.COLOR_1,
}, xAxisField: 'date', xAxisFormatter: xFormatter, xAxisMin: new Date('2014-12-31T00:00-08:00'), xAxisMax: new Date('2015-01-07T00:00-08:00'), xAxisTickCount: 5, xAxisTitle: 'Date', yAxisFields: ['blueberries'], yAxisFormatter: yFormatter, yAxisTickCount: 5, yAxisTitle: 'Number of Blueberries', yAxisTitleColor: index_1.chartConstants.COLOR_0, y2AxisFields: ['oranges'], y2AxisFormatter: yFormatter, y2AxisTickCount: 5, y2AxisTitle: 'Number of Oranges', y2AxisHasPoints: false, y2AxisTitleColor: index_1.chartConstants.COLOR_1 })));
},
});
//# sourceMappingURL=07.all-the-things.js.map