@record-evolution/widget-linechart 1.4.13 → 1.4.15
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.4.
|
|
6
|
+
"version": "1.4.15",
|
|
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
|
@@ -55,38 +55,33 @@ export class WidgetLinechart extends LitElement {
|
|
|
55
55
|
.monochromatic(distincts.length)
|
|
56
56
|
.map((c: any) => c.toHexString())
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
this.canvasList.get(chartName)?.dataSets.push(pds)
|
|
82
|
-
})
|
|
83
|
-
} else {
|
|
84
|
-
if (!this.canvasList.has(ds.chartName)) {
|
|
58
|
+
distincts.forEach((piv, i) => {
|
|
59
|
+
const prefix = piv ? `${piv} - ` : ''
|
|
60
|
+
const pds: any = {
|
|
61
|
+
label: prefix + ds.label ?? '',
|
|
62
|
+
type: ds.type,
|
|
63
|
+
showLine: true,
|
|
64
|
+
radius: ds.radius,
|
|
65
|
+
pointStyle: ds.pointStyle,
|
|
66
|
+
backgroundColor: ds.chartName?.includes('#pivot#')
|
|
67
|
+
? ds.backgroundColor
|
|
68
|
+
: derivedBgColors[i],
|
|
69
|
+
borderColor: ds.chartName?.includes('#pivot#') ? ds.borderColor : derivedBdColors[i],
|
|
70
|
+
borderWidth: ds.borderWidth,
|
|
71
|
+
borderDash: ds.borderDash,
|
|
72
|
+
fill: ds.fill,
|
|
73
|
+
data: distincts.length === 1 ? ds.data : ds.data?.filter((d) => d.pivot === piv)
|
|
74
|
+
}
|
|
75
|
+
// If the chartName ends with :pivot: then create a seperate chart for each pivoted dataseries
|
|
76
|
+
const chartName = ds.chartName?.includes('#pivot#')
|
|
77
|
+
? ds.chartName + '-' + piv
|
|
78
|
+
: ds.chartName ?? ''
|
|
79
|
+
if (!this.canvasList.has(chartName)) {
|
|
85
80
|
// initialize new charts
|
|
86
|
-
this.canvasList.set(
|
|
81
|
+
this.canvasList.set(chartName, { chart: undefined, dataSets: [] as Dataseries[] })
|
|
87
82
|
}
|
|
88
|
-
this.canvasList.get(
|
|
89
|
-
}
|
|
83
|
+
this.canvasList.get(chartName)?.dataSets.push(pds)
|
|
84
|
+
})
|
|
90
85
|
})
|
|
91
86
|
// prevent duplicate transformation
|
|
92
87
|
this.inputData.dataseries = []
|