Adjust chart plugin copy (#8595)
* Adjust chart plugin copy * Adjust * Remove cast * constants
This commit is contained in:
parent
dbbb64869c
commit
de7ff8e4e1
@ -35,7 +35,7 @@ interface Config {
|
||||
|
||||
const COLORS = ['#ff8c00', '#008c8c', '#8c008c'];
|
||||
|
||||
const chartOptions: ChartOptions = {
|
||||
const BASE_OPTS: ChartOptions = {
|
||||
animation: {
|
||||
duration: 0
|
||||
},
|
||||
@ -85,7 +85,10 @@ function calculateOptions (colors: (string | undefined)[] = [], legends: string[
|
||||
|
||||
return {
|
||||
chartData,
|
||||
chartOptions: objectSpread({}, chartOptions, options)
|
||||
chartOptions: objectSpread({}, BASE_OPTS, options, {
|
||||
// Re-spread plugins for deep(er) copy
|
||||
plugins: objectSpread({}, BASE_OPTS.plugins, options.plugins)
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user