import { BaseBuilder } from '@chartisan/chartisan' ; import type { EChartsOption as Configuration , SeriesOption , TitleComponentOption } from 'echarts' ; export class Builder extends BaseBuilder < Configuration , Builder > { returns { Builder } public copy ( ) { return new Builder ( JSON . parse ( JSON . stringify ( this . configuration ) ) ) ; } param text returns { this } public title ( title ) { if ( typeof title === 'string' ) { title = { text : title } ; } return this . options ( { title } ) ; } param dataset returns public dataset ( dataset ) { return this . options ( { series : [ dataset ] } ) ; } param datasets returns public datasets ( datasets ) { for ( const dataset of datasets ) { this . dataset ( dataset ) ; } return this ; } param data returns public labels ( data ) { return this . options ( { xAxis : { data } } ) ; } param { boolean | Configuration [ 'legend' ] } legend returns { this } public legend ( legend ) { if ( typeof legend === 'boolean' ) { legend = { show : legend } ; } return this . options ( { legend } ) ; } param { boolean | Configuration [ 'grid' ] } grid returns { this } public grid ( grid ) { if ( typeof grid === 'boolean' ) { grid = { show : grid } ; } return this . options ( { grid } ) ; } param { boolean | Configuration [ 'tooltip' ] } tooltip returns { this } public tooltip ( tooltip ) { if ( typeof tooltip === 'boolean' ) { tooltip = { show : tooltip } ; } return this . options ( { tooltip } ) ; } param { boolean | Configuration [ 'toolbox' ] } toolbox returns { this } public toolbox ( toolbox ) { if ( typeof toolbox === 'boolean' ) { toolbox = { show : toolbox } ; } return this . options ( { toolbox } ) ; } param { boolean | Configuration [ 'aria' ] } aria returns { this } public aria ( aria ) { if ( typeof aria === 'boolean' ) { aria = { enabled : aria } ; } return this . options ( { aria } ) ; } param { Configuration [ 'color' ] } color returns { this } public colors ( color ) { return this . color ( color ) ; } param { Configuration [ 'color' ] } color returns { this } public color ( color ) { return this . options ( { color } ) ; } param { string } color returns { this } public backgroundColor ( backgroundColor ) { return this . options ( { backgroundColor } ) ; } param { Configuration [ 'textStyle' ] } textStyle returns { this } public textStyle ( textStyle ) { return this . options ( { textStyle } ) ; } param { Configuration [ 'textStyle' ] } animation returns public animation ( animation ) { return this . options ( { animation } ) ; } param { Configuration [ 'animationThreshold' ] } animationThreshold returns { this } public animationThreshold ( animationThreshold ) { return this . options ( { animationThreshold } ) ; } param { Configuration [ 'animationDuration' ] } animationDuration returns { this } public animationDuration ( animationDuration ) { return this . options ( { animationDuration } ) ; } param { Configuration [ 'animationEasing' ] } animationEasing returns { this } public animationEasing ( animationEasing ) { return this . options ( { animationEasing } ) ; } param { Configuration [ 'animationDelay' ] } animationDelay returns { this } public animationDelay ( animationDelay ) { return this . options ( { animationDelay } ) ; } }