@operato/chart 8.0.0-beta.0 → 8.0.0-beta.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.
- package/CHANGELOG.md +9 -0
- package/package.json +6 -6
- package/.editorconfig +0 -29
- package/.storybook/main.js +0 -3
- package/.storybook/preview.js +0 -52
- package/.storybook/server.mjs +0 -8
- package/src/chartjs/config-converter.ts +0 -341
- package/src/chartjs/ox-chart-js.ts +0 -207
- package/src/editors/configurer.ts +0 -336
- package/src/editors/index.ts +0 -8
- package/src/editors/input-chart-abstract.ts +0 -202
- package/src/editors/input-chart-styles.ts +0 -206
- package/src/editors/ox-input-chart-hbar.ts +0 -157
- package/src/editors/ox-input-chart-mixed.ts +0 -241
- package/src/editors/ox-input-chart-pie.ts +0 -69
- package/src/editors/ox-input-chart-radar.ts +0 -56
- package/src/editors/ox-input-chart-timeseries.ts +0 -279
- package/src/editors/ox-property-editor-chart.ts +0 -72
- package/src/editors/templates/annotations.ts +0 -295
- package/src/editors/templates/display-value.ts +0 -111
- package/src/editors/templates/series.ts +0 -316
- package/src/global.d.ts +0 -1
- package/src/index.ts +0 -0
- package/src/progress/ox-progress-circle.ts +0 -133
- package/src/scichart/ox-scichart.ts +0 -151
- package/src/scichart/scichart-builder.ts +0 -508
- package/src/types.d.ts +0 -124
- package/stories/common.ts +0 -87
- package/stories/ox-input-chart-bar.stories.ts +0 -188
- package/stories/ox-input-chart-doughnut.stories.ts +0 -130
- package/stories/ox-input-chart-hbar.stories.ts +0 -188
- package/stories/ox-input-chart-line.stories.ts +0 -198
- package/stories/ox-input-chart-pie.stories.ts +0 -130
- package/stories/ox-input-chart-polar-area.stories.ts +0 -130
- package/stories/ox-input-chart-radar.stories.ts +0 -141
- package/stories/ox-input-chart-timeseries.stories.ts +0 -268
- package/tsconfig.json +0 -25
- package/web-dev-server.config.mjs +0 -27
- package/web-test-runner.config.mjs +0 -41
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { css } from 'lit'
|
|
2
|
-
|
|
3
|
-
export const InputChartStyles = css`
|
|
4
|
-
:host {
|
|
5
|
-
display: grid;
|
|
6
|
-
grid-template-columns: repeat(10, 1fr);
|
|
7
|
-
grid-gap: 5px;
|
|
8
|
-
|
|
9
|
-
background-color: var(--ox-input-background-color, var(--md-sys-color-surface));
|
|
10
|
-
color: var(--ox-input-color, var(--md-sys-color-on-surface));
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:host > * {
|
|
14
|
-
box-sizing: border-box;
|
|
15
|
-
grid-column: span 7;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
:host > label {
|
|
19
|
-
box-sizing: border-box;
|
|
20
|
-
grid-column: span 3;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
:host > legend {
|
|
24
|
-
box-sizing: border-box;
|
|
25
|
-
grid-column: 1 / -1;
|
|
26
|
-
color: var(--md-sys-color-on-secondary-container, #e46c2e);
|
|
27
|
-
font: var(--property-sidebar-fieldset-legend, bold 13px var(--theme-font));
|
|
28
|
-
text-transform: capitalize;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
#series-properties-container,
|
|
32
|
-
#annotations-properties-container {
|
|
33
|
-
display: grid;
|
|
34
|
-
grid-template-columns: 1fr 25px;
|
|
35
|
-
align-items: center;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
#series-properties-container > [tab-content],
|
|
40
|
-
#annotations-properties-container > [tab-content] {
|
|
41
|
-
grid-column: span 2;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
#series-tab-header,
|
|
45
|
-
#annotations-tab-header {
|
|
46
|
-
display: grid;
|
|
47
|
-
grid-template-columns: 25px 1fr 25px;
|
|
48
|
-
grid-gap: 5px;
|
|
49
|
-
overflow: hidden;
|
|
50
|
-
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
51
|
-
border-bottom: 0;
|
|
52
|
-
background-color: var(--md-sys-color-surface-variant);
|
|
53
|
-
color: var(--md-sys-color-on-surface);
|
|
54
|
-
box-sizing: border-box;
|
|
55
|
-
padding-top: 3px;
|
|
56
|
-
align-items: center;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
#series-tab-header > div,
|
|
60
|
-
#annotations-tab-header > div {
|
|
61
|
-
height: 25px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
#series-tab-header md-icon[disabled],
|
|
65
|
-
#annotations-tab-header md-icon[disabled] {
|
|
66
|
-
opacity: 0.1;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
#series-tabs,
|
|
70
|
-
#annotations-tabs {
|
|
71
|
-
display: flex;
|
|
72
|
-
overflow: hidden;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
#series-tab-header #series-tabs [tab] md-icon,
|
|
76
|
-
#annotations-tab-header #annotations-tabs [tab] md-icon {
|
|
77
|
-
margin-left: auto;
|
|
78
|
-
padding: 2px;
|
|
79
|
-
color: var(--md-sys-color-on-surface);
|
|
80
|
-
|
|
81
|
-
--md-icon-size: 12px;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
#add-series-button-container,
|
|
85
|
-
#add-annotation-button-container {
|
|
86
|
-
height: 100%;
|
|
87
|
-
box-sizing: border-box;
|
|
88
|
-
align-items: center;
|
|
89
|
-
justify-content: center;
|
|
90
|
-
padding-top: 3px;
|
|
91
|
-
display: flex;
|
|
92
|
-
border-bottom: rgba(0, 0, 0, 0.2) 1px solid;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
#add-series-button,
|
|
96
|
-
#add-annotation-button {
|
|
97
|
-
width: 20px;
|
|
98
|
-
height: 20px;
|
|
99
|
-
padding: 0;
|
|
100
|
-
color: var(--md-sys-color-on-secondary-container);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.tab-content {
|
|
104
|
-
grid-column: 1 / -1;
|
|
105
|
-
|
|
106
|
-
background-color: rgba(255, 255, 255, 0.5);
|
|
107
|
-
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
108
|
-
border-width: 0 1px 1px 1px;
|
|
109
|
-
padding: 5px;
|
|
110
|
-
display: grid;
|
|
111
|
-
grid-template-columns: repeat(10, 1fr);
|
|
112
|
-
grid-gap: 5px;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.tab-content > * {
|
|
116
|
-
box-sizing: border-box;
|
|
117
|
-
grid-column: span 7;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
label,
|
|
121
|
-
.tab-content > label {
|
|
122
|
-
grid-column: span 3;
|
|
123
|
-
text-align: right;
|
|
124
|
-
color: var(--md-sys-color-on-secondary-container);
|
|
125
|
-
font-size: 0.8em;
|
|
126
|
-
line-height: 2;
|
|
127
|
-
text-transform: capitalize;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
input,
|
|
131
|
-
select {
|
|
132
|
-
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
133
|
-
border-radius: var(--spacing-small);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
input[type='checkbox'],
|
|
137
|
-
.tab-content > input[type='checkbox'] {
|
|
138
|
-
grid-column: span 4;
|
|
139
|
-
justify-self: end;
|
|
140
|
-
align-self: center;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
input[type='checkbox'] + label,
|
|
144
|
-
.tab-content > input[type='checkbox'] + label {
|
|
145
|
-
grid-column: span 6;
|
|
146
|
-
|
|
147
|
-
text-align: left;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
[fullwidth] {
|
|
151
|
-
grid-column: 1 / -1;
|
|
152
|
-
margin: 0;
|
|
153
|
-
border: 0;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
div[tab] {
|
|
157
|
-
display: flex;
|
|
158
|
-
align-items: center;
|
|
159
|
-
background-color: rgba(0, 0, 0, 0.2);
|
|
160
|
-
border-width: 1px 1px 0 1px;
|
|
161
|
-
padding: 0 5px;
|
|
162
|
-
color: var(--md-sys-color-on-surface);
|
|
163
|
-
box-sizing: border-box;
|
|
164
|
-
min-width: 45px;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
div[tab][disabled] {
|
|
168
|
-
background-color: rgba(0, 0, 0, 0.1);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
div[tab]:last-child {
|
|
172
|
-
border-width: 0;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
div[tab][selected] {
|
|
176
|
-
background-color: var(--md-sys-color-surface);
|
|
177
|
-
color: var(--md-sys-color-on-surface);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
#display-value-container {
|
|
181
|
-
display: grid;
|
|
182
|
-
grid-template-columns: repeat(10, 1fr);
|
|
183
|
-
grid-gap: 5px;
|
|
184
|
-
|
|
185
|
-
background-color: var(--ox-input-background-color, var(--md-sys-color-surface));
|
|
186
|
-
color: var(--ox-input-color, var(--md-sys-color-on-surface));
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
#display-value-container > * {
|
|
190
|
-
box-sizing: border-box;
|
|
191
|
-
grid-column: span 7;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
#display-value-container > label {
|
|
195
|
-
box-sizing: border-box;
|
|
196
|
-
grid-column: span 3;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
#display-value-container > legend {
|
|
200
|
-
box-sizing: border-box;
|
|
201
|
-
grid-column: 1 / -1;
|
|
202
|
-
color: var(--md-sys-color-on-secondary-container, #e46c2e);
|
|
203
|
-
font: var(--property-sidebar-fieldset-legend, bold 13px var(--theme-font));
|
|
204
|
-
text-transform: capitalize;
|
|
205
|
-
}
|
|
206
|
-
`
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import '@material/web/icon/icon.js'
|
|
2
|
-
import '@operato/input/ox-input-color.js'
|
|
3
|
-
import '@operato/i18n/ox-i18n.js'
|
|
4
|
-
|
|
5
|
-
import { html } from 'lit'
|
|
6
|
-
import { customElement } from 'lit/decorators.js'
|
|
7
|
-
import { ifDefined } from 'lit/directives/if-defined.js'
|
|
8
|
-
|
|
9
|
-
import { InputChartAbstract } from './input-chart-abstract'
|
|
10
|
-
|
|
11
|
-
import './templates/display-value'
|
|
12
|
-
|
|
13
|
-
@customElement('ox-input-chart-hbar')
|
|
14
|
-
export class OxInputChartHBar extends InputChartAbstract {
|
|
15
|
-
static styles = InputChartAbstract.styles
|
|
16
|
-
|
|
17
|
-
subTemplate() {
|
|
18
|
-
const configurer = this.configurer
|
|
19
|
-
|
|
20
|
-
return html`
|
|
21
|
-
<legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
|
|
22
|
-
<ox-chart-series
|
|
23
|
-
.configurer=${configurer}
|
|
24
|
-
.chartType=${this.chartType}
|
|
25
|
-
value-key="datasets"
|
|
26
|
-
fullwidth
|
|
27
|
-
></ox-chart-series>
|
|
28
|
-
|
|
29
|
-
<legend><ox-i18n msgid="label.y-axes">Y Axes</ox-i18n></legend>
|
|
30
|
-
|
|
31
|
-
<label for="label-data-key"> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
|
32
|
-
<input id="label-data-key" type="text" value-key="labelDataKey" value=${ifDefined(configurer.labelDataKey)} />
|
|
33
|
-
|
|
34
|
-
<label for="y-axes0-axis-title"> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
|
35
|
-
<input
|
|
36
|
-
id="y-axes0-axis-title"
|
|
37
|
-
type="text"
|
|
38
|
-
value-key="yAxes0.axisTitle"
|
|
39
|
-
value=${ifDefined(configurer.yAxes0.axisTitle)}
|
|
40
|
-
/>
|
|
41
|
-
|
|
42
|
-
<label for="y-axes0-bar-spacing"><ox-i18n msgid="label.bar-spacing">Bar Spacing</ox-i18n></label>
|
|
43
|
-
<input
|
|
44
|
-
id="y-axes0-bar-spacing"
|
|
45
|
-
type="number"
|
|
46
|
-
min="0"
|
|
47
|
-
max="1"
|
|
48
|
-
step="0.1"
|
|
49
|
-
value-key="yAxes0.barSpacing"
|
|
50
|
-
value=${ifDefined(configurer.yAxes0.barSpacing)}
|
|
51
|
-
/>
|
|
52
|
-
<label for="y-axes0-category-spacing"><ox-i18n msgid="label.tick-spacing">Tick Spacing</ox-i18n></label>
|
|
53
|
-
<input
|
|
54
|
-
id="y-axes0-category-spacing"
|
|
55
|
-
type="number"
|
|
56
|
-
min="0"
|
|
57
|
-
max="1"
|
|
58
|
-
step="0.1"
|
|
59
|
-
value-key="yAxes0.categorySpacing"
|
|
60
|
-
value=${ifDefined(configurer.yAxes0.categorySpacing)}
|
|
61
|
-
/>
|
|
62
|
-
|
|
63
|
-
<input
|
|
64
|
-
id="x-grid-line"
|
|
65
|
-
type="checkbox"
|
|
66
|
-
value-key="value.options.xGridLine"
|
|
67
|
-
?checked=${configurer.config.options?.xGridLine}
|
|
68
|
-
/>
|
|
69
|
-
<label for="x-grid-line"> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
|
70
|
-
|
|
71
|
-
<input
|
|
72
|
-
id="x-axes0-ticks-display"
|
|
73
|
-
type="checkbox"
|
|
74
|
-
value-key="xAxes0.ticks.display"
|
|
75
|
-
?checked=${configurer.xAxes0.ticks?.display}
|
|
76
|
-
/>
|
|
77
|
-
<label for="x-axes0-ticks-display"> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
|
78
|
-
|
|
79
|
-
<legend><ox-i18n msgid="label.x-axes">X Axes</ox-i18n></legend>
|
|
80
|
-
|
|
81
|
-
<label for="x-axes0-axis-title"> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
|
82
|
-
<input
|
|
83
|
-
id="x-axes0-axis-title"
|
|
84
|
-
type="text"
|
|
85
|
-
value-key="xAxes0.axisTitle"
|
|
86
|
-
.value=${configurer.xAxes0.axisTitle || ''}
|
|
87
|
-
/>
|
|
88
|
-
|
|
89
|
-
<input
|
|
90
|
-
id="x-axes0-axis-min-auto"
|
|
91
|
-
type="checkbox"
|
|
92
|
-
value-key="xAxes0.ticks.autoMin"
|
|
93
|
-
?checked=${configurer.xAxes0.ticks?.autoMin}
|
|
94
|
-
/>
|
|
95
|
-
<label for="x-axes0-axis-min-auto"> <ox-i18n msgid="label.axis-min-auto">Axis Min Auto</ox-i18n> </label>
|
|
96
|
-
|
|
97
|
-
<input
|
|
98
|
-
id="x-axes0-ticks-auto-max"
|
|
99
|
-
type="checkbox"
|
|
100
|
-
value-key="xAxes0.ticks.autoMax"
|
|
101
|
-
?checked=${configurer.xAxes0.ticks?.autoMax}
|
|
102
|
-
/>
|
|
103
|
-
<label for="x-axes0-ticks-auto-max"> <ox-i18n msgid="label.axis-max-auto">Axis Max Auto</ox-i18n> </label>
|
|
104
|
-
|
|
105
|
-
${!configurer.xAxes0.ticks?.autoMin
|
|
106
|
-
? html`
|
|
107
|
-
<label for="x-axes0-ticks-min"> <ox-i18n msgid="label.axis-min">Axis Min</ox-i18n> </label>
|
|
108
|
-
<input
|
|
109
|
-
id="x-axes0-ticks-min"
|
|
110
|
-
type="number"
|
|
111
|
-
value-key="xAxes0.ticks.min"
|
|
112
|
-
value=${ifDefined(configurer.xAxes0.ticks?.min)}
|
|
113
|
-
/>
|
|
114
|
-
`
|
|
115
|
-
: html``}
|
|
116
|
-
${!configurer.xAxes0.ticks?.autoMax
|
|
117
|
-
? html`
|
|
118
|
-
<label for="x-axes0-ticks-max"> <ox-i18n msgid="label.axis-max">Axis Max</ox-i18n> </label>
|
|
119
|
-
<input
|
|
120
|
-
id="x-axes0-ticks-max"
|
|
121
|
-
type="number"
|
|
122
|
-
value-key="xAxes0.ticks.max"
|
|
123
|
-
value=${ifDefined(configurer.xAxes0.ticks?.max)}
|
|
124
|
-
/>
|
|
125
|
-
`
|
|
126
|
-
: html``}
|
|
127
|
-
|
|
128
|
-
<label for="y-axes0-ticks-step-size"> <ox-i18n msgid="label.axis-step-size">Axis Step Size</ox-i18n> </label>
|
|
129
|
-
<input
|
|
130
|
-
id="y-axes0-ticks-step-size"
|
|
131
|
-
type="number"
|
|
132
|
-
value-key="yAxes0.ticks.stepSize"
|
|
133
|
-
value=${ifDefined(configurer.yAxes0.ticks?.stepSize)}
|
|
134
|
-
/>
|
|
135
|
-
|
|
136
|
-
<input
|
|
137
|
-
id="y-grid-line"
|
|
138
|
-
type="checkbox"
|
|
139
|
-
value-key="value.options.yGridLine"
|
|
140
|
-
?checked=${configurer.config.options?.yGridLine}
|
|
141
|
-
/>
|
|
142
|
-
<label for="y-grid-line"> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
|
143
|
-
|
|
144
|
-
<input
|
|
145
|
-
id="y-axes0-ticks-display"
|
|
146
|
-
type="checkbox"
|
|
147
|
-
value-key="yAxes0.ticks.display"
|
|
148
|
-
?checked=${configurer.yAxes0.ticks?.display}
|
|
149
|
-
/>
|
|
150
|
-
<label for="y-axes0-ticks-display"> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
|
151
|
-
`
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
getDefaultDatasets(): OperatoChart.Dataset[] {
|
|
155
|
-
return [this.getDefaultDataset('horizontalBar')]
|
|
156
|
-
}
|
|
157
|
-
}
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import '@operato/i18n/ox-i18n.js'
|
|
2
|
-
|
|
3
|
-
import { html } from 'lit'
|
|
4
|
-
import { customElement } from 'lit/decorators.js'
|
|
5
|
-
import { ifDefined } from 'lit/directives/if-defined.js'
|
|
6
|
-
|
|
7
|
-
import { InputChartAbstract } from './input-chart-abstract'
|
|
8
|
-
import './templates/series'
|
|
9
|
-
|
|
10
|
-
@customElement('ox-input-chart-mixed')
|
|
11
|
-
export class OxInputChartMixed extends InputChartAbstract {
|
|
12
|
-
static styles = InputChartAbstract.styles
|
|
13
|
-
|
|
14
|
-
subTemplate() {
|
|
15
|
-
const configurer = this.configurer
|
|
16
|
-
|
|
17
|
-
return html`
|
|
18
|
-
<input id="multi-axis" type="checkbox" value-key="multiAxis" ?checked=${configurer.multiAxis} />
|
|
19
|
-
<label for="multi-axis"> <ox-i18n msgid="label.multi-axis">Multi Axis</ox-i18n> </label>
|
|
20
|
-
|
|
21
|
-
<legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
|
|
22
|
-
<ox-chart-series
|
|
23
|
-
.configurer=${configurer}
|
|
24
|
-
.chartType=${this.chartType}
|
|
25
|
-
value-key="datasets"
|
|
26
|
-
fullwidth
|
|
27
|
-
></ox-chart-series>
|
|
28
|
-
|
|
29
|
-
<legend><ox-i18n msgid="label.x-axes">X Axes</ox-i18n></legend>
|
|
30
|
-
|
|
31
|
-
<label for="series-data-key"> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
|
32
|
-
<input id="series-data-key" type="text" value-key="labelDataKey" value=${ifDefined(configurer.labelDataKey)} />
|
|
33
|
-
|
|
34
|
-
<label for="x-axes0-axis-title"> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
|
35
|
-
<input
|
|
36
|
-
id="x-axes0-axis-title"
|
|
37
|
-
type="text"
|
|
38
|
-
value-key="xAxes0.axisTitle"
|
|
39
|
-
value=${ifDefined(configurer.xAxes0.axisTitle)}
|
|
40
|
-
/>
|
|
41
|
-
|
|
42
|
-
${this._hasBarSeries(configurer.value)
|
|
43
|
-
? html`
|
|
44
|
-
<label for="bar-spacing"><ox-i18n msgid="label.bar-spacing">Bar Spacing</ox-i18n></label>
|
|
45
|
-
<input
|
|
46
|
-
id="bar-spacing"
|
|
47
|
-
type="number"
|
|
48
|
-
min="0"
|
|
49
|
-
max="1"
|
|
50
|
-
step="0.1"
|
|
51
|
-
value-key="xAxes0.barSpacing"
|
|
52
|
-
value=${ifDefined(configurer.xAxes0.barSpacing)}
|
|
53
|
-
/>
|
|
54
|
-
<label for="tick-spacing"><ox-i18n msgid="label.tick-spacing">Tick Spacing</ox-i18n></label>
|
|
55
|
-
<input
|
|
56
|
-
id="tick-spacing"
|
|
57
|
-
type="number"
|
|
58
|
-
min="0"
|
|
59
|
-
max="1"
|
|
60
|
-
step="0.1"
|
|
61
|
-
value-key="xAxes0.categorySpacing"
|
|
62
|
-
value=${ifDefined(configurer.xAxes0.categorySpacing)}
|
|
63
|
-
/>
|
|
64
|
-
`
|
|
65
|
-
: html``}
|
|
66
|
-
|
|
67
|
-
<input
|
|
68
|
-
id="x-grid-line"
|
|
69
|
-
type="checkbox"
|
|
70
|
-
value-key="value.options.xGridLine"
|
|
71
|
-
?checked=${configurer.config.options?.xGridLine}
|
|
72
|
-
/>
|
|
73
|
-
<label for="x-grid-line"> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
|
74
|
-
|
|
75
|
-
<input
|
|
76
|
-
id="x-axes0-ticks-display"
|
|
77
|
-
type="checkbox"
|
|
78
|
-
value-key="xAxes0.ticks.display"
|
|
79
|
-
?checked=${configurer.xAxes0.ticks?.display}
|
|
80
|
-
/>
|
|
81
|
-
<label for="x-axes0-ticks-display"> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
|
82
|
-
|
|
83
|
-
<legend><ox-i18n msgid="label.y-axes">Y Axes</ox-i18n></legend>
|
|
84
|
-
|
|
85
|
-
<label for="y-axes0-axis-title"> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
|
86
|
-
<input
|
|
87
|
-
id="y-axes0-axis-title"
|
|
88
|
-
type="text"
|
|
89
|
-
value-key="yAxes0.axisTitle"
|
|
90
|
-
value=${configurer.yAxes0.axisTitle || ''}
|
|
91
|
-
/>
|
|
92
|
-
|
|
93
|
-
<input
|
|
94
|
-
id="axis-min-auto"
|
|
95
|
-
type="checkbox"
|
|
96
|
-
value-key="yAxes0.ticks.autoMin"
|
|
97
|
-
?checked=${configurer.yAxes0.ticks?.autoMin}
|
|
98
|
-
/>
|
|
99
|
-
<label for="axis-min-auto"> <ox-i18n msgid="label.axis-min-auto">Min Auto</ox-i18n> </label>
|
|
100
|
-
|
|
101
|
-
<input
|
|
102
|
-
id="axis-max-auto"
|
|
103
|
-
type="checkbox"
|
|
104
|
-
value-key="yAxes0.ticks.autoMax"
|
|
105
|
-
?checked=${configurer.yAxes0.ticks?.autoMax}
|
|
106
|
-
/>
|
|
107
|
-
<label for="axis-max-auto"> <ox-i18n msgid="label.axis-max-auto">Max Auto</ox-i18n> </label>
|
|
108
|
-
|
|
109
|
-
${!configurer.yAxes0.ticks?.autoMin
|
|
110
|
-
? html`
|
|
111
|
-
<label for="y-axes0-ticks-min"> <ox-i18n msgid="label.axis-min">Min</ox-i18n> </label>
|
|
112
|
-
<input
|
|
113
|
-
id="y-axes0-ticks-min"
|
|
114
|
-
type="number"
|
|
115
|
-
value-key="yAxes0.ticks.min"
|
|
116
|
-
value=${ifDefined(configurer.yAxes0.ticks?.min)}
|
|
117
|
-
/>
|
|
118
|
-
`
|
|
119
|
-
: html``}
|
|
120
|
-
${!configurer.yAxes0.ticks?.autoMax
|
|
121
|
-
? html`
|
|
122
|
-
<label for="y-axes0-ticks-max"> <ox-i18n msgid="label.axis-max">Max</ox-i18n> </label>
|
|
123
|
-
<input
|
|
124
|
-
id="y-axes0-ticks-max"
|
|
125
|
-
type="number"
|
|
126
|
-
value-key="yAxes0.ticks.max"
|
|
127
|
-
value=${ifDefined(configurer.yAxes0.ticks?.max)}
|
|
128
|
-
/>
|
|
129
|
-
`
|
|
130
|
-
: html``}
|
|
131
|
-
|
|
132
|
-
<label for="y-axes0-ticks-step-size"> <ox-i18n msgid="label.axis-step-size">StepSize</ox-i18n> </label>
|
|
133
|
-
<input
|
|
134
|
-
id="y-axes0-ticks-step-size"
|
|
135
|
-
type="number"
|
|
136
|
-
value-key="yAxes0.ticks.stepSize"
|
|
137
|
-
value=${ifDefined(configurer.yAxes0.ticks?.stepSize)}
|
|
138
|
-
/>
|
|
139
|
-
|
|
140
|
-
<input
|
|
141
|
-
id="y-grid-line"
|
|
142
|
-
type="checkbox"
|
|
143
|
-
value-key="value.options.yGridLine"
|
|
144
|
-
?checked=${configurer.config.options?.yGridLine}
|
|
145
|
-
/>
|
|
146
|
-
<label for="y-grid-line"> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
|
147
|
-
|
|
148
|
-
<input
|
|
149
|
-
id="y-axes0-ticks-display"
|
|
150
|
-
type="checkbox"
|
|
151
|
-
value-key="yAxes0.ticks.display"
|
|
152
|
-
?checked=${configurer.yAxes0.ticks?.display}
|
|
153
|
-
/>
|
|
154
|
-
<label for="y-axes0-ticks-display"> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
|
155
|
-
|
|
156
|
-
${configurer.config.options?.multiAxis
|
|
157
|
-
? html`
|
|
158
|
-
<legend><ox-i18n msgid="label.y-2nd-axes">Y 2nd Axes</ox-i18n></legend>
|
|
159
|
-
|
|
160
|
-
<label for="y-axes1.axis-title"> <ox-i18n msgid="label.title">Title</ox-i18n> </label>
|
|
161
|
-
<input
|
|
162
|
-
id="y-axes1.axis-title"
|
|
163
|
-
type="text"
|
|
164
|
-
value-key="yAxes1.axisTitle"
|
|
165
|
-
value=${ifDefined(configurer.yAxes1?.axisTitle)}
|
|
166
|
-
/>
|
|
167
|
-
|
|
168
|
-
<input
|
|
169
|
-
id="y-axes1-ticks-auto-min"
|
|
170
|
-
type="checkbox"
|
|
171
|
-
value-key="yAxes1.ticks.autoMin"
|
|
172
|
-
?checked=${configurer.yAxes1?.ticks?.autoMin}
|
|
173
|
-
/>
|
|
174
|
-
<label for="y-axes1-ticks-auto-min"> <ox-i18n msgid="label.axis-min-auto">Min Auto</ox-i18n> </label>
|
|
175
|
-
|
|
176
|
-
<input
|
|
177
|
-
id="y-axes1-ticks-auto-max"
|
|
178
|
-
type="checkbox"
|
|
179
|
-
value-key="yAxes1.ticks.autoMax"
|
|
180
|
-
?checked=${configurer.yAxes1?.ticks?.autoMax}
|
|
181
|
-
/>
|
|
182
|
-
<label for="y-axes1-ticks-auto-max"> <ox-i18n msgid="label.axis-max-auto">Max Auto</ox-i18n> </label>
|
|
183
|
-
|
|
184
|
-
${!configurer.yAxes1?.ticks?.autoMin
|
|
185
|
-
? html`
|
|
186
|
-
<label for="y-axes1-ticks-min"> <ox-i18n msgid="label.axis-min">Min</ox-i18n> </label>
|
|
187
|
-
<input
|
|
188
|
-
id="y-axes1-ticks-min"
|
|
189
|
-
type="number"
|
|
190
|
-
value-key="yAxes1.ticks.min"
|
|
191
|
-
value=${ifDefined(configurer.yAxes1?.ticks?.min)}
|
|
192
|
-
/>
|
|
193
|
-
`
|
|
194
|
-
: html``}
|
|
195
|
-
${!configurer.yAxes1?.ticks?.autoMax
|
|
196
|
-
? html`
|
|
197
|
-
<label for="y-axes1-ticks-max"> <ox-i18n msgid="label.axis-max">Max</ox-i18n> </label>
|
|
198
|
-
<input
|
|
199
|
-
id="y-axes1-ticks-max"
|
|
200
|
-
type="number"
|
|
201
|
-
value-key="yAxes1.ticks.max"
|
|
202
|
-
value=${ifDefined(configurer.yAxes1?.ticks?.max)}
|
|
203
|
-
/>
|
|
204
|
-
`
|
|
205
|
-
: html``}
|
|
206
|
-
|
|
207
|
-
<label for="y-axes1-ticks-step-size"> <ox-i18n msgid="label.axis-step-size">StepSize</ox-i18n> </label>
|
|
208
|
-
<input
|
|
209
|
-
id="y-axes1-ticks-step-size"
|
|
210
|
-
type="number"
|
|
211
|
-
value-key="yAxes1.ticks.stepSize"
|
|
212
|
-
value=${ifDefined(configurer.yAxes1?.ticks?.stepSize)}
|
|
213
|
-
/>
|
|
214
|
-
|
|
215
|
-
<input
|
|
216
|
-
id="y-2nd-grid-line"
|
|
217
|
-
type="checkbox"
|
|
218
|
-
value-key="value.options.y2ndGridLine"
|
|
219
|
-
?checked=${configurer.config.options?.y2ndGridLine}
|
|
220
|
-
/>
|
|
221
|
-
<label for="y-2nd-grid-line"> <ox-i18n msgid="label.grid-line">Grid Line</ox-i18n> </label>
|
|
222
|
-
|
|
223
|
-
<input
|
|
224
|
-
id="y-axes1-ticks-display"
|
|
225
|
-
type="checkbox"
|
|
226
|
-
value-key="yAxes1.ticks.display"
|
|
227
|
-
?checked=${configurer.yAxes1?.ticks?.display}
|
|
228
|
-
/>
|
|
229
|
-
<label for="y-axes1-ticks-display"> <ox-i18n msgid="label.display-tick">Display Tick</ox-i18n> </label>
|
|
230
|
-
`
|
|
231
|
-
: html``}
|
|
232
|
-
`
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
_hasBarSeries(config: any) {
|
|
236
|
-
var hasBarSeries = false
|
|
237
|
-
hasBarSeries = config.data.datasets?.some((s: any) => s.type == 'bar')
|
|
238
|
-
|
|
239
|
-
return hasBarSeries
|
|
240
|
-
}
|
|
241
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import '@operato/i18n/ox-i18n.js'
|
|
2
|
-
import '@operato/input/ox-input-multiple-colors.js'
|
|
3
|
-
|
|
4
|
-
import { html } from 'lit'
|
|
5
|
-
import { customElement } from 'lit/decorators.js'
|
|
6
|
-
|
|
7
|
-
import { InputChartAbstract } from './input-chart-abstract'
|
|
8
|
-
import './templates/display-value'
|
|
9
|
-
|
|
10
|
-
@customElement('ox-input-chart-pie')
|
|
11
|
-
export default class OxInputChartPie extends InputChartAbstract {
|
|
12
|
-
static styles = InputChartAbstract.styles
|
|
13
|
-
|
|
14
|
-
subTemplate() {
|
|
15
|
-
const configurer = this.configurer
|
|
16
|
-
|
|
17
|
-
return html`
|
|
18
|
-
<legend><ox-i18n msgid="label.series">Series</ox-i18n></legend>
|
|
19
|
-
|
|
20
|
-
<label for="series-data-key"> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
|
21
|
-
<input id="series-data-key" type="text" value-key="dataKey" .value=${configurer.series.dataKey || ''} />
|
|
22
|
-
|
|
23
|
-
<label for="series-colors"> <ox-i18n msgid="label.color">Color</ox-i18n> </label>
|
|
24
|
-
<ox-input-multiple-colors
|
|
25
|
-
id="series-colors"
|
|
26
|
-
value-key="color"
|
|
27
|
-
.value=${configurer.color || []}
|
|
28
|
-
></ox-input-multiple-colors>
|
|
29
|
-
|
|
30
|
-
<label></label>
|
|
31
|
-
<ox-chart-display-value .configurer=${configurer} fullwidth></ox-chart-display-value>
|
|
32
|
-
|
|
33
|
-
<legend><ox-i18n msgid="label.axes">Axes</ox-i18n></legend>
|
|
34
|
-
|
|
35
|
-
<label for="series-data-key"> <ox-i18n msgid="label.data-key">Data Key</ox-i18n> </label>
|
|
36
|
-
<input id="series-data-key" type="text" value-key="labelDataKey" .value=${configurer.labelDataKey || ''} />
|
|
37
|
-
`
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
getDefaultChartConfig(type: OperatoChart.ChartType, datasets?: OperatoChart.Dataset[]): OperatoChart.ChartConfig {
|
|
41
|
-
return {
|
|
42
|
-
type: 'pie',
|
|
43
|
-
data: {
|
|
44
|
-
labels: [],
|
|
45
|
-
datasets: this.getDefaultDatasets(),
|
|
46
|
-
labelDataKey: 'label'
|
|
47
|
-
},
|
|
48
|
-
options: {
|
|
49
|
-
theme: 'dark',
|
|
50
|
-
legend: {
|
|
51
|
-
display: true,
|
|
52
|
-
position: 'top'
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
getDefaultDatasets(): OperatoChart.Dataset[] {
|
|
59
|
-
return [this.getDefaultDataset('pie')]
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
getDefaultDataset(seriesType: OperatoChart.SeriesType): OperatoChart.Dataset {
|
|
63
|
-
return {
|
|
64
|
-
backgroundColor: ['#FF6384', '#36A2EB', '#FFCE56'],
|
|
65
|
-
borderWidth: 0,
|
|
66
|
-
dataKey: 'value'
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|