@record-evolution/widget-linechart 1.6.10 → 1.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent widget-linechart following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "widget-linechart",
|
|
6
|
-
"version": "1.6.
|
|
6
|
+
"version": "1.6.11",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/widget-linechart.js",
|
|
9
9
|
"types": "dist/src/widget-linechart.d.ts",
|
package/src/widget-linechart.ts
CHANGED
|
@@ -310,9 +310,8 @@ export class WidgetLinechart extends LitElement {
|
|
|
310
310
|
|
|
311
311
|
this.canvasList.forEach((chart, label) => {
|
|
312
312
|
chart.series.sort((a, b) => ((a.name as string) > (b.name as string) ? 1 : -1))
|
|
313
|
-
this.requestUpdate()
|
|
314
313
|
|
|
315
|
-
const option: any = window.structuredClone(this.template)
|
|
314
|
+
const option: any = chart.echart?.getOption() ?? window.structuredClone(this.template)
|
|
316
315
|
// Title
|
|
317
316
|
option.title.text = label
|
|
318
317
|
// option.title.textStyle.fontSize = 25 * modifier
|
|
@@ -331,11 +330,10 @@ export class WidgetLinechart extends LitElement {
|
|
|
331
330
|
// option.yAxis.axisLabel.fontSize = 20 * modifier
|
|
332
331
|
option.yAxis.scale = this.inputData?.axis?.yAxisScaling ?? false
|
|
333
332
|
|
|
333
|
+
const notMerge = option.series.length !== chart.series.length
|
|
334
334
|
option.series = chart.series
|
|
335
335
|
// console.log('Applying data to chart', label, option)
|
|
336
336
|
if (chart.series.length <= 1) option.legend.show = false
|
|
337
|
-
const oldOption: any = chart.echart?.getOption() ?? {}
|
|
338
|
-
const notMerge = oldOption.series?.length !== chart.series.length
|
|
339
337
|
chart.echart?.setOption(option, { notMerge })
|
|
340
338
|
// chart.echart?.resize()
|
|
341
339
|
})
|