import AchoViz from '../../src'; import { timeParse } from 'd3'; import { raw } from './data'; // const data = [ // { // x: 1, // y: 135.98, // }, // { // x: 2, // y: 147.49, // }, // { // x: 3, // y: 146.93, // }, // { // x: 4, // y: 139.89, // }, // { // x: 5, // y: 125.6, // }, // { // x: 6, // y: 108.13, // }, // ]; const data = raw.map((d) => ({ ...d, date: timeParse('%Y-%m-%d')(d.date) })); const margin = { top: 10, right: 30, bottom: 30, left: 60 }; const opts = { height: 400, width: 460, margin, useToolTip: true, xField: 'date', yField: 'value', xTransform: 'time' }; const line = new AchoViz.LineChart({ ...opts, elementId: '#linechart', data }); line.render();