import { Chartisan } from './Index' ; import { use } from 'echarts/core' ; import { BarChart } from 'echarts/charts' ; import { TitleComponent , GridComponent } from 'echarts/components' ; import { CanvasRenderer } from 'echarts/renderers' ; use ( [ TitleComponent , GridComponent , BarChart , CanvasRenderer ] ) ; document . addEventListener ( 'DOMContentLoaded' , ( ) => { new Chartisan ( { name : 'my-chart' , element : document . getElementById ( 'chart' ) ! , chart : ( builder ) => builder . title ( 'Cool chart' ) . labels ( [ 'shirt' , 'cardign' , 'chiffon shirt' , 'pants' , 'heels' , 'socks' ] ) . datasets ( [ { name : 'Sales' , type : 'bar' , data : [ 15 , 10 , 26 , 30 , 20 , 10 ] } , { name : 'Sales 2' , type : 'bar' , data : [ 12 , 5 , 16 , 22 , 40 , 12 ] } , ] ) , } ) ; } ) ;