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