@operato/chart 7.0.0-rc.9 → 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.
- package/.storybook/preview.js +26 -3
- package/CHANGELOG.md +43 -0
- package/dist/src/chartjs/ox-chart-js.js +3 -0
- package/dist/src/chartjs/ox-chart-js.js.map +1 -1
- package/dist/src/editors/input-chart-styles.js +3 -0
- package/dist/src/editors/input-chart-styles.js.map +1 -1
- package/dist/src/progress/ox-progress-circle.d.ts +41 -0
- package/dist/src/progress/ox-progress-circle.js +169 -0
- package/dist/src/progress/ox-progress-circle.js.map +1 -0
- package/dist/src/scichart/ox-scichart.d.ts +2 -2
- package/dist/src/scichart/ox-scichart.js +26 -20
- package/dist/src/scichart/ox-scichart.js.map +1 -1
- package/dist/src/scichart/scichart-builder.d.ts +1 -1
- package/dist/src/scichart/scichart-builder.js +74 -20
- package/dist/src/scichart/scichart-builder.js.map +1 -1
- package/dist/stories/common.d.ts +1 -1
- package/dist/stories/common.js +31 -9
- package/dist/stories/common.js.map +1 -1
- package/dist/stories/ox-input-chart-bar.stories.js +33 -48
- package/dist/stories/ox-input-chart-bar.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-doughnut.stories.js +1 -1
- package/dist/stories/ox-input-chart-doughnut.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-hbar.stories.js +1 -1
- package/dist/stories/ox-input-chart-hbar.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-line.stories.js +1 -1
- package/dist/stories/ox-input-chart-line.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-pie.stories.js +1 -1
- package/dist/stories/ox-input-chart-pie.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-polar-area.stories.js +1 -1
- package/dist/stories/ox-input-chart-polar-area.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-radar.stories.js +1 -1
- package/dist/stories/ox-input-chart-radar.stories.js.map +1 -1
- package/dist/stories/ox-input-chart-timeseries.stories.js +35 -45
- package/dist/stories/ox-input-chart-timeseries.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/chartjs/ox-chart-js.ts +3 -0
- package/src/editors/input-chart-styles.ts +3 -0
- package/src/progress/ox-progress-circle.ts +133 -0
- package/src/scichart/ox-scichart.ts +33 -29
- package/src/scichart/scichart-builder.ts +92 -38
- package/stories/common.ts +36 -9
- package/stories/ox-input-chart-bar.stories.ts +32 -46
- package/stories/ox-input-chart-doughnut.stories.ts +1 -1
- package/stories/ox-input-chart-hbar.stories.ts +1 -1
- package/stories/ox-input-chart-line.stories.ts +1 -1
- package/stories/ox-input-chart-pie.stories.ts +1 -1
- package/stories/ox-input-chart-polar-area.stories.ts +1 -1
- package/stories/ox-input-chart-radar.stories.ts +1 -1
- package/stories/ox-input-chart-timeseries.stories.ts +34 -43
|
@@ -2,7 +2,6 @@ import { LitElement, html, css } from 'lit'
|
|
|
2
2
|
import { property, query, customElement } from 'lit/decorators.js'
|
|
3
3
|
import { buildSciChart } from './scichart-builder'
|
|
4
4
|
|
|
5
|
-
// 전역 변수로 SciChart 로딩 상태 관리
|
|
6
5
|
declare global {
|
|
7
6
|
interface Window {
|
|
8
7
|
sciChartLoaded: boolean
|
|
@@ -18,7 +17,7 @@ class OxSciChart extends LitElement {
|
|
|
18
17
|
@property({ type: String, attribute: 'attr-y' }) attrY: string = 'y'
|
|
19
18
|
|
|
20
19
|
private chart: any = null
|
|
21
|
-
dataSeries
|
|
20
|
+
private dataSeries: any[] = []
|
|
22
21
|
|
|
23
22
|
@query('div#container') container!: HTMLDivElement
|
|
24
23
|
|
|
@@ -65,7 +64,7 @@ class OxSciChart extends LitElement {
|
|
|
65
64
|
const { chart, dataSeries } = (await buildSciChart(this.config, this.container, {})) || {}
|
|
66
65
|
|
|
67
66
|
this.chart = chart
|
|
68
|
-
this.dataSeries = dataSeries
|
|
67
|
+
this.dataSeries = dataSeries!
|
|
69
68
|
|
|
70
69
|
this.updateDataSeries()
|
|
71
70
|
}
|
|
@@ -82,45 +81,50 @@ class OxSciChart extends LitElement {
|
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
updateDataSeries() {
|
|
85
|
-
if (!this.dataSeries) return
|
|
84
|
+
if (!this.dataSeries?.length) return
|
|
86
85
|
|
|
87
|
-
this.dataSeries.clear()
|
|
86
|
+
this.dataSeries.forEach(ds => ds.clear())
|
|
88
87
|
const newData = this.dataSet
|
|
89
88
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
newData.forEach((data, index) => {
|
|
90
|
+
this.dataSeries[index].appendRange(
|
|
91
|
+
data.map(d => d.xValue),
|
|
92
|
+
data.map(d => d.yValue)
|
|
93
|
+
)
|
|
94
|
+
})
|
|
94
95
|
|
|
95
96
|
this.chart?.sciChartSurface.zoomExtents()
|
|
96
97
|
this.chart?.sciChartSurface.invalidateElement()
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
get dataSet(): { xValue: number; yValue: number }[] {
|
|
100
|
-
const { attrX,
|
|
100
|
+
get dataSet(): { xValue: number; yValue: number }[][] {
|
|
101
|
+
const { attrX, data } = this
|
|
102
|
+
const datasets = this.config?.data?.datasets || []
|
|
101
103
|
|
|
102
104
|
if (!(data instanceof Array)) {
|
|
103
105
|
return []
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
return datasets.map(dataset => {
|
|
109
|
+
return data
|
|
110
|
+
.map(item => {
|
|
111
|
+
if (!item || typeof item !== 'object') {
|
|
112
|
+
return
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const xValue = new Date(item[attrX])
|
|
116
|
+
if (isNaN(xValue.getTime())) {
|
|
117
|
+
console.error('Invalid date:', item[attrX])
|
|
118
|
+
return
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return {
|
|
122
|
+
xValue: xValue.getTime() / 1000,
|
|
123
|
+
yValue: item[dataset.dataKey!]
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
.filter(Boolean) as { xValue: number; yValue: number }[]
|
|
127
|
+
})
|
|
124
128
|
}
|
|
125
129
|
|
|
126
130
|
render() {
|
|
@@ -1,87 +1,141 @@
|
|
|
1
|
+
import { TinyColor } from '@ctrl/tinycolor'
|
|
2
|
+
import { format as formatText } from '../utils/text-formatter'
|
|
3
|
+
|
|
1
4
|
export async function buildSciChart(
|
|
2
5
|
config: OperatoChart.ChartConfig | undefined | null,
|
|
3
6
|
container: any,
|
|
4
|
-
{ fontSize, fontFamily, fontColor }: { fontSize?: number; fontFamily?: string; fontColor?: string }
|
|
5
|
-
): Promise<{ chart: any; dataSeries: any } | undefined> {
|
|
7
|
+
{ fontSize, fontFamily, fontColor = 'red' }: { fontSize?: number; fontFamily?: string; fontColor?: string }
|
|
8
|
+
): Promise<{ chart: any; dataSeries: any[] } | undefined> {
|
|
6
9
|
if (!config) {
|
|
7
10
|
return
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
const {
|
|
11
14
|
SciChartSurface,
|
|
12
|
-
SciChartDefaults,
|
|
13
|
-
chartBuilder,
|
|
14
15
|
SciChartJsNavyTheme,
|
|
15
16
|
XyDataSeries,
|
|
16
17
|
FastLineRenderableSeries,
|
|
17
|
-
|
|
18
|
+
FastColumnRenderableSeries,
|
|
19
|
+
NumericAxis,
|
|
20
|
+
DateTimeNumericAxis,
|
|
18
21
|
EAutoRange,
|
|
19
22
|
EAxisAlignment,
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
NumberRange,
|
|
24
|
+
MouseWheelZoomModifier,
|
|
25
|
+
RubberBandXyZoomModifier,
|
|
26
|
+
ZoomExtentsModifier,
|
|
27
|
+
RolloverModifier
|
|
22
28
|
} = SciChart
|
|
23
29
|
|
|
24
30
|
const { type: chartType, options, data: fromData } = config
|
|
25
|
-
const {
|
|
26
|
-
theme,
|
|
27
|
-
animation,
|
|
28
|
-
tooltip,
|
|
29
|
-
stacked,
|
|
30
|
-
legend,
|
|
31
|
-
scales: fromScales,
|
|
32
|
-
xGridLine,
|
|
33
|
-
yGridLine,
|
|
34
|
-
y2ndGridLine,
|
|
35
|
-
multiAxis
|
|
36
|
-
} = options || {}
|
|
31
|
+
const { theme, legend, scales: fromScales, xGridLine, yGridLine, y2ndGridLine } = options || {}
|
|
37
32
|
const { datasets = [] } = fromData || {}
|
|
38
33
|
|
|
39
34
|
const { xAxes = [], yAxes = [] } = fromScales || {}
|
|
40
|
-
const toScales = {} as any
|
|
41
35
|
|
|
42
36
|
const chart = await SciChartSurface.create(container, {
|
|
43
37
|
theme: new SciChartJsNavyTheme()
|
|
44
38
|
})
|
|
45
39
|
const { sciChartSurface, wasmContext } = chart
|
|
46
40
|
|
|
41
|
+
// X 축 설정
|
|
47
42
|
xAxes.forEach((axis, index) => {
|
|
48
|
-
const { axisTitle,
|
|
49
|
-
const { autoMax, autoMin } = ticks || {}
|
|
43
|
+
const { axisTitle, ticks } = axis
|
|
44
|
+
const { autoMax, autoMin, min, max, stepSize, beginAtZero } = ticks || {}
|
|
50
45
|
const id = xAxes.length > 1 ? `x${index + 1}` : 'x'
|
|
51
46
|
|
|
52
47
|
const xAxis = new DateTimeNumericAxis(wasmContext, {
|
|
53
48
|
axisTitle,
|
|
54
|
-
autoRange: EAutoRange.Always,
|
|
55
|
-
axisAlignment: EAxisAlignment.Bottom
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
autoRange: autoMin || autoMax ? EAutoRange.Always : undefined,
|
|
50
|
+
axisAlignment: EAxisAlignment.Bottom,
|
|
51
|
+
visibleRange: min !== undefined && max !== undefined ? new NumberRange(min, max) : undefined,
|
|
52
|
+
majorDelta: stepSize,
|
|
53
|
+
growBy: beginAtZero ? new NumberRange(0.1, 0.1) : undefined,
|
|
54
|
+
labelStyle: {
|
|
55
|
+
fontFamily,
|
|
56
|
+
fontSize,
|
|
57
|
+
color: fontColor
|
|
58
|
+
},
|
|
59
|
+
axisTitleStyle: {
|
|
60
|
+
fontFamily,
|
|
61
|
+
fontSize,
|
|
62
|
+
color: fontColor
|
|
63
|
+
}
|
|
58
64
|
})
|
|
59
65
|
|
|
60
66
|
sciChartSurface.xAxes.add(xAxis)
|
|
61
67
|
})
|
|
62
68
|
|
|
69
|
+
// Y 축 설정
|
|
63
70
|
yAxes.forEach((axis, index) => {
|
|
64
|
-
const { axisTitle,
|
|
65
|
-
const { autoMax, autoMin } = ticks || {}
|
|
66
|
-
|
|
71
|
+
const { axisTitle, ticks } = axis
|
|
72
|
+
const { autoMax, autoMin, min, max, stepSize, beginAtZero } = ticks || {}
|
|
67
73
|
const id = yAxes.length > 1 ? `right` : 'left'
|
|
68
74
|
|
|
69
75
|
const yAxis = new NumericAxis(wasmContext, {
|
|
70
76
|
axisTitle,
|
|
71
|
-
autoRange: EAutoRange.Always,
|
|
72
|
-
axisAlignment: yAxes.length > 1 ? EAxisAlignment.Right : EAxisAlignment.Left
|
|
77
|
+
autoRange: autoMin || autoMax ? EAutoRange.Always : undefined,
|
|
78
|
+
axisAlignment: yAxes.length > 1 ? EAxisAlignment.Right : EAxisAlignment.Left,
|
|
79
|
+
visibleRange: min !== undefined && max !== undefined ? new NumberRange(min, max) : undefined,
|
|
80
|
+
majorDelta: stepSize,
|
|
81
|
+
growBy: beginAtZero ? new NumberRange(0.1, 0.1) : undefined,
|
|
82
|
+
labelStyle: {
|
|
83
|
+
fontFamily,
|
|
84
|
+
fontSize,
|
|
85
|
+
color: fontColor
|
|
86
|
+
},
|
|
87
|
+
axisTitleStyle: {
|
|
88
|
+
fontFamily,
|
|
89
|
+
fontSize,
|
|
90
|
+
color: fontColor
|
|
91
|
+
}
|
|
73
92
|
})
|
|
74
93
|
sciChartSurface.yAxes.add(yAxis)
|
|
75
94
|
})
|
|
76
95
|
|
|
77
|
-
|
|
96
|
+
// 시리즈 설정
|
|
97
|
+
const dataSeriesArray = datasets.map((dataset, index) => {
|
|
98
|
+
const dataSeries = new XyDataSeries(wasmContext, {
|
|
99
|
+
dataSeriesName: dataset.label,
|
|
100
|
+
containsNaN: false
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
let series: any
|
|
104
|
+
if (dataset.type === 'bar') {
|
|
105
|
+
series = new FastColumnRenderableSeries(wasmContext, {
|
|
106
|
+
dataSeries,
|
|
107
|
+
strokeThickness: dataset.borderWidth || 2,
|
|
108
|
+
fill: dataset.backgroundColor || '#FF6600'
|
|
109
|
+
})
|
|
110
|
+
} else {
|
|
111
|
+
series = new FastLineRenderableSeries(wasmContext, {
|
|
112
|
+
dataSeries,
|
|
113
|
+
strokeThickness: dataset.borderWidth || 2,
|
|
114
|
+
stroke: dataset.color || '#FF6600'
|
|
115
|
+
})
|
|
116
|
+
}
|
|
78
117
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
118
|
+
sciChartSurface.renderableSeries.add(series)
|
|
119
|
+
|
|
120
|
+
const rolloverModifier = new RolloverModifier({
|
|
121
|
+
showTooltip: true,
|
|
122
|
+
showAxisLabels: true,
|
|
123
|
+
tooltipColor: 'white',
|
|
124
|
+
tooltipBackgroundColor: 'rgba(0, 0, 0, 0.7)',
|
|
125
|
+
rollOverDataSeries: dataSeries
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
sciChartSurface.chartModifiers.add(rolloverModifier)
|
|
129
|
+
|
|
130
|
+
return dataSeries
|
|
131
|
+
})
|
|
83
132
|
|
|
84
|
-
|
|
133
|
+
// 줌인/줌아웃 모디파이어 추가
|
|
134
|
+
sciChartSurface.chartModifiers.add(
|
|
135
|
+
new RubberBandXyZoomModifier(),
|
|
136
|
+
new MouseWheelZoomModifier(),
|
|
137
|
+
new ZoomExtentsModifier()
|
|
138
|
+
)
|
|
85
139
|
|
|
86
|
-
return { chart, dataSeries }
|
|
140
|
+
return { chart, dataSeries: dataSeriesArray }
|
|
87
141
|
}
|
package/stories/common.ts
CHANGED
|
@@ -46,12 +46,39 @@ export function getDefaultAxisOptions(): OperatoChart.AxisOptions {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export const data = [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
]
|
|
49
|
+
// export const data = [
|
|
50
|
+
// { timestamp: 2010, count: 10, average: 120 },
|
|
51
|
+
// { timestamp: 2011, count: 20, average: 110 },
|
|
52
|
+
// { timestamp: 2012, count: 15, average: 80 },
|
|
53
|
+
// { timestamp: 2013, count: 25, average: 130 },
|
|
54
|
+
// { timestamp: 2014, count: 22, average: 120 },
|
|
55
|
+
// { timestamp: 2015, count: 30, average: 60 },
|
|
56
|
+
// { timestamp: 2016, count: 28, average: 90 }
|
|
57
|
+
// ]
|
|
58
|
+
// 랜덤한 범위의 숫자를 생성하는 함수
|
|
59
|
+
function getRandomInRange(min: number, max: number) {
|
|
60
|
+
return Math.floor(Math.random() * (max - min + 1)) + min
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// 랜덤 데이터를 생성하는 함수
|
|
64
|
+
function generateRandomData(count: number) {
|
|
65
|
+
const randomData = []
|
|
66
|
+
const startTimestamp = Math.floor(Date.now() / 1000) // 현재 시간을 Unix 타임스탬프로 설정
|
|
67
|
+
|
|
68
|
+
for (let i = 0; i < count; i++) {
|
|
69
|
+
const timestamp = startTimestamp + i * 3 // 3초씩 증가하는 타임스탬프 설정
|
|
70
|
+
const randomCount = getRandomInRange(5, 35) // count 값을 5에서 35 사이로 랜덤 생성
|
|
71
|
+
const randomAverage = getRandomInRange(50, 150) // average 값을 50에서 150 사이로 랜덤 생성
|
|
72
|
+
|
|
73
|
+
randomData.push({
|
|
74
|
+
timestamp: timestamp,
|
|
75
|
+
count: randomCount,
|
|
76
|
+
average: randomAverage
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return randomData
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 100개의 랜덤 데이터를 생성
|
|
84
|
+
export const data = generateRandomData(100)
|
|
@@ -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
|
-
.
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
57
|
-
background-color:
|
|
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
|
-
|
|
85
|
+
gap: var(--spacing-medium);
|
|
70
86
|
}
|
|
71
87
|
|
|
72
88
|
#chartjs {
|
|
@@ -78,40 +94,10 @@ const Template: Story<ArgTypes> = ({ value }: ArgTypes) => html`
|
|
|
78
94
|
}
|
|
79
95
|
</style>
|
|
80
96
|
|
|
81
|
-
<div
|
|
82
|
-
Type 'count' or 'average' for series dataKey, type 'year' for axis's dataKey
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<div class="container light">
|
|
86
|
-
<ox-input-chart-mixed
|
|
87
|
-
chart-type="bar"
|
|
88
|
-
id="editor"
|
|
89
|
-
.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
|
-
}
|
|
97
|
+
<div class="desc">Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey</div>
|
|
101
98
|
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
}}
|
|
114
|
-
></ox-input-chart-mixed>
|
|
99
|
+
<div class="container">
|
|
100
|
+
<ox-input-chart-mixed chart-type="bar" id="editor" .value=${value} @change=${showCharts}></ox-input-chart-mixed>
|
|
115
101
|
<div id="charts">
|
|
116
102
|
<ox-chart-js id="chartjs" .data=${data}></ox-chart-js>
|
|
117
103
|
<ox-scichart id="scichart"></ox-scichart>
|
|
@@ -135,7 +121,7 @@ WithData.args = {
|
|
|
135
121
|
{
|
|
136
122
|
label: 'Bar Series',
|
|
137
123
|
type: 'bar',
|
|
138
|
-
|
|
124
|
+
dataKey: 'count',
|
|
139
125
|
backgroundColor: 'rgba(255, 99, 132, 0.2)',
|
|
140
126
|
borderColor: 'rgba(255, 99, 132, 1)',
|
|
141
127
|
borderWidth: 1
|
|
@@ -143,7 +129,7 @@ WithData.args = {
|
|
|
143
129
|
{
|
|
144
130
|
label: 'Line Series',
|
|
145
131
|
type: 'line',
|
|
146
|
-
|
|
132
|
+
dataKey: 'average',
|
|
147
133
|
borderColor: 'rgba(54, 162, 235, 1)',
|
|
148
134
|
borderWidth: 1,
|
|
149
135
|
fill: false,
|
|
@@ -152,7 +138,7 @@ WithData.args = {
|
|
|
152
138
|
pointRadius: 3
|
|
153
139
|
}
|
|
154
140
|
],
|
|
155
|
-
labelDataKey: '
|
|
141
|
+
labelDataKey: 'timestamp'
|
|
156
142
|
},
|
|
157
143
|
options: {
|
|
158
144
|
scales: {
|
|
@@ -177,7 +163,7 @@ MultiAxis.args = {
|
|
|
177
163
|
{
|
|
178
164
|
label: 'Bar Series',
|
|
179
165
|
type: 'bar',
|
|
180
|
-
|
|
166
|
+
dataKey: 'count',
|
|
181
167
|
backgroundColor: 'rgba(255, 99, 132, 0.2)',
|
|
182
168
|
borderColor: 'rgba(255, 99, 132, 1)',
|
|
183
169
|
borderWidth: 1,
|
|
@@ -186,7 +172,7 @@ MultiAxis.args = {
|
|
|
186
172
|
{
|
|
187
173
|
label: 'Line Series',
|
|
188
174
|
type: 'line',
|
|
189
|
-
|
|
175
|
+
dataKey: 'average',
|
|
190
176
|
borderColor: 'rgba(54, 162, 235, 1)',
|
|
191
177
|
borderWidth: 1,
|
|
192
178
|
fill: false,
|
|
@@ -196,7 +182,7 @@ MultiAxis.args = {
|
|
|
196
182
|
yAxisID: 'right'
|
|
197
183
|
}
|
|
198
184
|
],
|
|
199
|
-
labelDataKey: '
|
|
185
|
+
labelDataKey: 'timestamp'
|
|
200
186
|
}
|
|
201
187
|
}
|
|
202
188
|
}
|
|
@@ -68,7 +68,7 @@ const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => h
|
|
|
68
68
|
</style>
|
|
69
69
|
|
|
70
70
|
<div style="background-color: black; color: white;">
|
|
71
|
-
Type 'count' or 'average' for series dataKey, type '
|
|
71
|
+
Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
|
|
72
72
|
</div>
|
|
73
73
|
|
|
74
74
|
<div class="container light">
|
|
@@ -79,7 +79,7 @@ const Template: Story<ArgTypes> = ({ value }: ArgTypes) => html`
|
|
|
79
79
|
</style>
|
|
80
80
|
|
|
81
81
|
<div style="background-color: black; color: white;">
|
|
82
|
-
Type 'count' or 'average' for series dataKey, type '
|
|
82
|
+
Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
|
|
83
83
|
</div>
|
|
84
84
|
<div class="container light">
|
|
85
85
|
<ox-input-chart-hbar
|
|
@@ -79,7 +79,7 @@ const Template: Story<ArgTypes> = ({ value }: ArgTypes) => html`
|
|
|
79
79
|
</style>
|
|
80
80
|
|
|
81
81
|
<div style="background-color: black; color: white;">
|
|
82
|
-
Type 'count' or 'average' for series dataKey, type '
|
|
82
|
+
Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
|
|
83
83
|
</div>
|
|
84
84
|
|
|
85
85
|
<div class="container light">
|
|
@@ -68,7 +68,7 @@ const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => h
|
|
|
68
68
|
</style>
|
|
69
69
|
|
|
70
70
|
<div style="background-color: black; color: white;">
|
|
71
|
-
Type 'count' or 'average' for series dataKey, type '
|
|
71
|
+
Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
|
|
72
72
|
</div>
|
|
73
73
|
|
|
74
74
|
<div class="container light">
|
|
@@ -68,7 +68,7 @@ const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => h
|
|
|
68
68
|
</style>
|
|
69
69
|
|
|
70
70
|
<div style="background-color: black; color: white;">
|
|
71
|
-
Type 'count' or 'average' for series dataKey, type '
|
|
71
|
+
Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
|
|
72
72
|
</div>
|
|
73
73
|
|
|
74
74
|
<div class="container light">
|
|
@@ -68,7 +68,7 @@ const Template: Story<ArgTypes> = ({ value, currentSeriesIndex }: ArgTypes) => h
|
|
|
68
68
|
</style>
|
|
69
69
|
|
|
70
70
|
<div style="background-color: black; color: white;">
|
|
71
|
-
Type 'count' or 'average' for series dataKey, type '
|
|
71
|
+
Type 'count' or 'average' for series dataKey, type 'timestamp' for axis's dataKey
|
|
72
72
|
</div>
|
|
73
73
|
|
|
74
74
|
<div class="container light">
|