@operato/chart 7.0.0 → 7.0.1

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/src/progress/ox-progress-circle.d.ts +41 -0
  3. package/dist/src/progress/ox-progress-circle.js +169 -0
  4. package/dist/src/progress/ox-progress-circle.js.map +1 -0
  5. package/dist/src/scichart/ox-scichart.d.ts +2 -2
  6. package/dist/src/scichart/ox-scichart.js +26 -20
  7. package/dist/src/scichart/ox-scichart.js.map +1 -1
  8. package/dist/src/scichart/scichart-builder.d.ts +1 -1
  9. package/dist/src/scichart/scichart-builder.js +74 -20
  10. package/dist/src/scichart/scichart-builder.js.map +1 -1
  11. package/dist/stories/common.d.ts +1 -1
  12. package/dist/stories/common.js +31 -9
  13. package/dist/stories/common.js.map +1 -1
  14. package/dist/stories/ox-input-chart-bar.stories.js +32 -47
  15. package/dist/stories/ox-input-chart-bar.stories.js.map +1 -1
  16. package/dist/stories/ox-input-chart-doughnut.stories.js +1 -1
  17. package/dist/stories/ox-input-chart-doughnut.stories.js.map +1 -1
  18. package/dist/stories/ox-input-chart-hbar.stories.js +1 -1
  19. package/dist/stories/ox-input-chart-hbar.stories.js.map +1 -1
  20. package/dist/stories/ox-input-chart-line.stories.js +1 -1
  21. package/dist/stories/ox-input-chart-line.stories.js.map +1 -1
  22. package/dist/stories/ox-input-chart-pie.stories.js +1 -1
  23. package/dist/stories/ox-input-chart-pie.stories.js.map +1 -1
  24. package/dist/stories/ox-input-chart-polar-area.stories.js +1 -1
  25. package/dist/stories/ox-input-chart-polar-area.stories.js.map +1 -1
  26. package/dist/stories/ox-input-chart-radar.stories.js +1 -1
  27. package/dist/stories/ox-input-chart-radar.stories.js.map +1 -1
  28. package/dist/stories/ox-input-chart-timeseries.stories.js +35 -45
  29. package/dist/stories/ox-input-chart-timeseries.stories.js.map +1 -1
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +2 -2
  32. package/src/progress/ox-progress-circle.ts +133 -0
  33. package/src/scichart/ox-scichart.ts +33 -29
  34. package/src/scichart/scichart-builder.ts +92 -38
  35. package/stories/common.ts +36 -9
  36. package/stories/ox-input-chart-bar.stories.ts +31 -45
  37. package/stories/ox-input-chart-doughnut.stories.ts +1 -1
  38. package/stories/ox-input-chart-hbar.stories.ts +1 -1
  39. package/stories/ox-input-chart-line.stories.ts +1 -1
  40. package/stories/ox-input-chart-pie.stories.ts +1 -1
  41. package/stories/ox-input-chart-polar-area.stories.ts +1 -1
  42. package/stories/ox-input-chart-radar.stories.ts +1 -1
  43. package/stories/ox-input-chart-timeseries.stories.ts +34 -43
@@ -24,6 +24,19 @@ interface ArgTypes {
24
24
  value: OperatoChart.ChartConfig
25
25
  }
26
26
 
27
+ function showCharts(e: Event) {
28
+ const target = e.currentTarget as any
29
+ const config = target.value
30
+ const chartjs = document.querySelector('#chartjs') as HTMLElement
31
+ if (chartjs) {
32
+ ;(chartjs as any).config = { ...config }
33
+ }
34
+ const scichart = document.querySelector('#scichart') as HTMLElement
35
+ if (scichart) {
36
+ ;(scichart as any).config = config
37
+ }
38
+ }
39
+
27
40
  const Template: Story<ArgTypes> = ({ value }: ArgTypes) => html`
28
41
  <link
29
42
  href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
@@ -43,18 +56,21 @@ const Template: Story<ArgTypes> = ({ value }: ArgTypes) => html`
43
56
  <link href="/themes/spacing.css" rel="stylesheet" />
44
57
 
45
58
  <style>
46
- .container {
47
- width: 100%;
48
- height: 100%;
59
+ .desc {
60
+ color: var(--md-sys-color-background);
61
+ background-color: var(--md-sys-color-on-background);
62
+ padding: var(--spacing-small);
63
+ }
49
64
 
65
+ .container {
50
66
  display: flex;
51
67
  flex-direction: row;
52
68
  overflow-y: auto;
53
69
  padding: var(--spacing-medium);
54
- }
70
+ gap: var(--spacing-medium);
55
71
 
56
- .container.dark {
57
- background-color: black;
72
+ color: var(--md-sys-color-on-background);
73
+ background-color: var(--md-sys-color-background);
58
74
  }
59
75
 
60
76
  #editor {
@@ -66,7 +82,7 @@ const Template: Story<ArgTypes> = ({ value }: ArgTypes) => html`
66
82
 
67
83
  display: flex;
68
84
  flex-direction: column;
69
- padding: 10px;
85
+ gap: var(--spacing-medium);
70
86
  }
71
87
 
72
88
  #chartjs {
@@ -78,42 +94,17 @@ const Template: Story<ArgTypes> = ({ value }: ArgTypes) => html`
78
94
  }
79
95
  </style>
80
96
 
81
- <div style="background-color: black; color: white;">
82
- Type 'count' or 'average' for series dataKey, type 'year' for axis's dataKey
83
- </div>
97
+ <div class="desc">Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey</div>
84
98
 
85
- <div class="container light">
99
+ <div class="container">
86
100
  <ox-input-chart-timeseries
87
101
  chart-type="line"
88
102
  id="editor"
89
103
  .value=${value}
90
- @change=${(e: CustomEvent) => {
91
- const target = e.currentTarget as any
92
- const config = target.value
93
- const chartjs = document.querySelector('#chartjs') as HTMLElement
94
- if (chartjs) {
95
- ;(chartjs as any).config = { ...config }
96
- }
97
- const scichart = document.querySelector('#scichart') as HTMLElement
98
- if (scichart) {
99
- ;(scichart as any).config = config
100
- }
101
-
102
- const container = document.querySelector('.container') as HTMLElement
103
- if (container) {
104
- const theme = config.options.theme
105
- if (theme == 'dark') {
106
- container.classList.remove('light')
107
- container.classList.add('dark')
108
- } else {
109
- container.classList.remove('dark')
110
- container.classList.add('light')
111
- }
112
- }
113
- }}
104
+ @change=${showCharts}
114
105
  ></ox-input-chart-timeseries>
115
106
  <div id="charts">
116
- <ox-scichart id="scichart" .data=${data} attr-x="year" attr-y="count"></ox-scichart>
107
+ <ox-scichart id="scichart" .data=${data} attr-x="timestamp" attr-y="count"></ox-scichart>
117
108
  <ox-chart-js id="chartjs" .data=${data}></ox-chart-js>
118
109
  </div>
119
110
  </div>
@@ -132,23 +123,21 @@ WithData.args = {
132
123
  dataKey: 'count',
133
124
  label: 'Line Series count',
134
125
  type: 'line',
135
- backgroundColor: 'rgba(255, 99, 132, 0.2)',
136
- borderColor: 'rgba(255, 99, 132, 1)',
126
+ color: 'rgba(255, 99, 132, 1)',
137
127
  borderWidth: 1
138
128
  },
139
129
  {
140
130
  dataKey: 'average',
141
131
  label: 'Line Series average',
142
132
  type: 'line',
143
- borderColor: 'rgba(54, 162, 235, 1)',
144
- borderWidth: 1,
133
+ color: 'rgba(54, 162, 235, 1)',
145
134
  fill: false,
146
135
  lineTension: 0.4,
147
136
  pointStyle: 'circle',
148
137
  pointRadius: 3
149
138
  }
150
139
  ],
151
- labelDataKey: 'year'
140
+ labelDataKey: 'timestamp'
152
141
  },
153
142
  options: {
154
143
  scales: {
@@ -173,6 +162,7 @@ MultiAxis.args = {
173
162
  {
174
163
  label: 'Bar Series',
175
164
  type: 'bar',
165
+ dataKey: 'count',
176
166
  backgroundColor: 'rgba(255, 99, 132, 0.2)',
177
167
  borderColor: 'rgba(255, 99, 132, 1)',
178
168
  borderWidth: 1,
@@ -181,7 +171,8 @@ MultiAxis.args = {
181
171
  {
182
172
  label: 'Line Series',
183
173
  type: 'line',
184
- borderColor: 'rgba(54, 162, 235, 1)',
174
+ dataKey: 'average',
175
+ color: 'rgba(54, 162, 235, 1)',
185
176
  borderWidth: 1,
186
177
  fill: false,
187
178
  lineTension: 0.4,
@@ -190,7 +181,7 @@ MultiAxis.args = {
190
181
  yAxisID: 'right'
191
182
  }
192
183
  ],
193
- labelDataKey: 'labels'
184
+ labelDataKey: 'timestamp'
194
185
  }
195
186
  }
196
187
  }