@operato/scene-scichart 7.2.4 → 7.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,100 @@
1
+ 2024-08-03T15:13:56+09:00 info: Initializing ConnectionManager...
2
+ 2024-08-03T15:13:56+09:00 info: Connector 'echo-back-server' started to ready
3
+ 2024-08-03T15:13:56+09:00 info: Connector 'echo-back' started to ready
4
+ 2024-08-03T15:13:56+09:00 info: Connector 'http-connector' started to ready
5
+ 2024-08-03T15:13:56+09:00 info: Connector 'graphql-connector' started to ready
6
+ 2024-08-03T15:13:56+09:00 info: Connector 'sqlite-connector' started to ready
7
+ 2024-08-03T15:13:56+09:00 info: Connector 'postgresql-connector' started to ready
8
+ 2024-08-03T15:13:56+09:00 info: Connector 'mqtt-connector' started to ready
9
+ 2024-08-03T15:13:56+09:00 info: Connector 'mssql-connector' started to ready
10
+ 2024-08-03T15:13:56+09:00 info: Connector 'oracle-connector' started to ready
11
+ 2024-08-03T15:13:56+09:00 info: Connector 'mysql-connector' started to ready
12
+ 2024-08-03T15:13:56+09:00 info: Connector 'socket-server' started to ready
13
+ 2024-08-03T15:13:56+09:00 info: Connector 'operato-connector' started to ready
14
+ 2024-08-03T15:13:56+09:00 info: Connector 'email-connector' started to ready
15
+ 2024-08-03T15:13:56+09:00 info: Connector 'influxdb-connector' started to ready
16
+ 2024-08-03T15:13:56+09:00 info: Connector 'msgraph-connector' started to ready
17
+ 2024-08-03T15:13:56+09:00 info: Connector 'proxy-connector' started to ready
18
+ 2024-08-03T15:13:56+09:00 info: echo-back-servers are ready
19
+ 2024-08-03T15:13:56+09:00 info: echo-back connections are ready
20
+ 2024-08-03T15:13:56+09:00 info: http-connector connections are ready
21
+ 2024-08-03T15:13:56+09:00 info: graphql-connector connections are ready
22
+ 2024-08-03T15:13:56+09:00 info: sqlite-connector connections are ready
23
+ 2024-08-03T15:13:56+09:00 info: postgresql-connector connections are ready
24
+ 2024-08-03T15:13:56+09:00 info: mqtt-connector connections are ready
25
+ 2024-08-03T15:13:56+09:00 info: mssql-connector connections are ready
26
+ 2024-08-03T15:13:56+09:00 info: oracle-connector connections are ready
27
+ 2024-08-03T15:13:56+09:00 info: mysql-connector connections are ready
28
+ 2024-08-03T15:13:56+09:00 info: socket servers are ready
29
+ 2024-08-03T15:13:56+09:00 info: operato-connector connections are ready
30
+ 2024-08-03T15:13:56+09:00 info: email connections are ready
31
+ 2024-08-03T15:13:56+09:00 info: influxdb connections are ready
32
+ 2024-08-03T15:13:56+09:00 info: msgraph-connector connections are ready
33
+ 2024-08-03T15:13:56+09:00 info: proxy-connector connections are ready
34
+ 2024-08-03T15:13:56+09:00 info: All connector for 'echo-back-server' ready
35
+ 2024-08-03T15:13:56+09:00 info: All connector for 'echo-back' ready
36
+ 2024-08-03T15:13:56+09:00 info: All connector for 'http-connector' ready
37
+ 2024-08-03T15:13:56+09:00 info: All connector for 'graphql-connector' ready
38
+ 2024-08-03T15:13:56+09:00 info: All connector for 'sqlite-connector' ready
39
+ 2024-08-03T15:13:56+09:00 info: All connector for 'postgresql-connector' ready
40
+ 2024-08-03T15:13:56+09:00 info: All connector for 'mqtt-connector' ready
41
+ 2024-08-03T15:13:56+09:00 info: All connector for 'mssql-connector' ready
42
+ 2024-08-03T15:13:56+09:00 info: All connector for 'oracle-connector' ready
43
+ 2024-08-03T15:13:56+09:00 info: All connector for 'mysql-connector' ready
44
+ 2024-08-03T15:13:56+09:00 info: All connector for 'socket-server' ready
45
+ 2024-08-03T15:13:56+09:00 info: All connector for 'operato-connector' ready
46
+ 2024-08-03T15:13:56+09:00 info: All connector for 'email-connector' ready
47
+ 2024-08-03T15:13:56+09:00 info: All connector for 'influxdb-connector' ready
48
+ 2024-08-03T15:13:56+09:00 info: All connector for 'msgraph-connector' ready
49
+ 2024-08-03T15:13:56+09:00 info: All connector for 'proxy-connector' ready
50
+ 2024-08-03T15:13:56+09:00 info: ConnectionManager initialization done:
51
+ 2024-08-03T15:29:18+09:00 info: Initializing ConnectionManager...
52
+ 2024-08-03T15:29:18+09:00 info: Connector 'echo-back-server' started to ready
53
+ 2024-08-03T15:29:18+09:00 info: Connector 'echo-back' started to ready
54
+ 2024-08-03T15:29:18+09:00 info: Connector 'http-connector' started to ready
55
+ 2024-08-03T15:29:18+09:00 info: Connector 'graphql-connector' started to ready
56
+ 2024-08-03T15:29:18+09:00 info: Connector 'sqlite-connector' started to ready
57
+ 2024-08-03T15:29:18+09:00 info: Connector 'postgresql-connector' started to ready
58
+ 2024-08-03T15:29:18+09:00 info: Connector 'mqtt-connector' started to ready
59
+ 2024-08-03T15:29:18+09:00 info: Connector 'mssql-connector' started to ready
60
+ 2024-08-03T15:29:18+09:00 info: Connector 'oracle-connector' started to ready
61
+ 2024-08-03T15:29:18+09:00 info: Connector 'mysql-connector' started to ready
62
+ 2024-08-03T15:29:18+09:00 info: Connector 'socket-server' started to ready
63
+ 2024-08-03T15:29:18+09:00 info: Connector 'operato-connector' started to ready
64
+ 2024-08-03T15:29:18+09:00 info: Connector 'email-connector' started to ready
65
+ 2024-08-03T15:29:18+09:00 info: Connector 'influxdb-connector' started to ready
66
+ 2024-08-03T15:29:18+09:00 info: Connector 'msgraph-connector' started to ready
67
+ 2024-08-03T15:29:18+09:00 info: Connector 'proxy-connector' started to ready
68
+ 2024-08-03T15:29:18+09:00 info: echo-back-servers are ready
69
+ 2024-08-03T15:29:18+09:00 info: echo-back connections are ready
70
+ 2024-08-03T15:29:18+09:00 info: http-connector connections are ready
71
+ 2024-08-03T15:29:18+09:00 info: graphql-connector connections are ready
72
+ 2024-08-03T15:29:18+09:00 info: sqlite-connector connections are ready
73
+ 2024-08-03T15:29:18+09:00 info: postgresql-connector connections are ready
74
+ 2024-08-03T15:29:18+09:00 info: mqtt-connector connections are ready
75
+ 2024-08-03T15:29:18+09:00 info: mssql-connector connections are ready
76
+ 2024-08-03T15:29:18+09:00 info: oracle-connector connections are ready
77
+ 2024-08-03T15:29:18+09:00 info: mysql-connector connections are ready
78
+ 2024-08-03T15:29:18+09:00 info: socket servers are ready
79
+ 2024-08-03T15:29:18+09:00 info: operato-connector connections are ready
80
+ 2024-08-03T15:29:18+09:00 info: email connections are ready
81
+ 2024-08-03T15:29:18+09:00 info: influxdb connections are ready
82
+ 2024-08-03T15:29:18+09:00 info: msgraph-connector connections are ready
83
+ 2024-08-03T15:29:18+09:00 info: proxy-connector connections are ready
84
+ 2024-08-03T15:29:18+09:00 info: All connector for 'echo-back-server' ready
85
+ 2024-08-03T15:29:18+09:00 info: All connector for 'echo-back' ready
86
+ 2024-08-03T15:29:18+09:00 info: All connector for 'http-connector' ready
87
+ 2024-08-03T15:29:18+09:00 info: All connector for 'graphql-connector' ready
88
+ 2024-08-03T15:29:18+09:00 info: All connector for 'sqlite-connector' ready
89
+ 2024-08-03T15:29:18+09:00 info: All connector for 'postgresql-connector' ready
90
+ 2024-08-03T15:29:18+09:00 info: All connector for 'mqtt-connector' ready
91
+ 2024-08-03T15:29:18+09:00 info: All connector for 'mssql-connector' ready
92
+ 2024-08-03T15:29:18+09:00 info: All connector for 'oracle-connector' ready
93
+ 2024-08-03T15:29:18+09:00 info: All connector for 'mysql-connector' ready
94
+ 2024-08-03T15:29:18+09:00 info: All connector for 'socket-server' ready
95
+ 2024-08-03T15:29:18+09:00 info: All connector for 'operato-connector' ready
96
+ 2024-08-03T15:29:18+09:00 info: All connector for 'email-connector' ready
97
+ 2024-08-03T15:29:18+09:00 info: All connector for 'influxdb-connector' ready
98
+ 2024-08-03T15:29:18+09:00 info: All connector for 'msgraph-connector' ready
99
+ 2024-08-03T15:29:18+09:00 info: All connector for 'proxy-connector' ready
100
+ 2024-08-03T15:29:18+09:00 info: ConnectionManager initialization done:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@operato/scene-scichart",
3
3
  "description": "scichart wrapping component",
4
- "version": "7.2.4",
4
+ "version": "7.2.6",
5
5
  "license": "MIT",
6
6
  "things-scene": true,
7
7
  "author": "heartyoh",
@@ -59,5 +59,5 @@
59
59
  "prettier --write"
60
60
  ]
61
61
  },
62
- "gitHead": "1c3fa7fc84feeb634d52819edf3b661e0f967e27"
62
+ "gitHead": "192c803bf1530b2c367537d7a29fa147a3507de6"
63
63
  }
@@ -78,8 +78,20 @@ export class OxSciChartMultiple extends LitElement {
78
78
  async initializeSciChart() {
79
79
  this.cleanup()
80
80
 
81
+ // Overview 차트는 정확히 일치하는 시리즈 이름만 포함
82
+ const overviewDatasets =
83
+ this.config?.data.datasets.filter(dataset => this.visibleSeries.includes(dataset.dataKey!)) || []
84
+
81
85
  const { chart, dataSeries } =
82
- (await buildSciChartOverview(this.config, this.overviewContainer, {}, this.synchronizer)) || {}
86
+ (await buildSciChartOverview(
87
+ {
88
+ ...this.config,
89
+ data: { datasets: overviewDatasets }
90
+ },
91
+ this.overviewContainer,
92
+ {},
93
+ this.synchronizer
94
+ )) || {}
83
95
 
84
96
  this.verticalGroup.addSurfaceToGroup(chart.sciChartSurface)
85
97
 
@@ -151,30 +163,42 @@ export class OxSciChartMultiple extends LitElement {
151
163
 
152
164
  const newData = this.dataSet
153
165
 
154
- ;(this.groupCharts || []).forEach(({ dataKey, sciChartSurface, dataSeries }) => {
166
+ this.groupCharts.forEach(({ dataKey, sciChartSurface, dataSeries }) => {
155
167
  try {
156
- dataSeries.forEach(ds => ds.clear())
157
- const dataSet = newData.filter((data, index) => dataKey == datasets[index].dataKey!)
168
+ // dataKey로 시작하는 모든 시리즈를 업데이트
169
+ const relatedDatasets = datasets.filter(dataset => dataset.dataKey?.startsWith(dataKey))
158
170
 
159
- dataSet.forEach((data, index) => {
160
- const filteredData = data.filter(d => typeof d.yValue === 'number')
171
+ // relatedDatasets에 대해 해당하는 dataSeries를 업데이트
172
+ dataSeries.forEach((ds, index) => {
173
+ ds.clear()
161
174
 
162
- if (filteredData.length > 0) {
163
- dataSeries[index].appendRange(
164
- filteredData.map(d => d.xValue),
165
- filteredData.map(d => d.yValue)
175
+ const relatedDataset = relatedDatasets[index]
176
+ if (relatedDataset) {
177
+ const filteredData = newData[datasets.findIndex(ds => ds.dataKey === relatedDataset.dataKey)].filter(
178
+ d => typeof d.yValue === 'number'
166
179
  )
180
+
181
+ if (filteredData.length > 0) {
182
+ ds.appendRange(
183
+ filteredData.map(d => d.xValue),
184
+ filteredData.map(d => d.yValue)
185
+ )
186
+ }
167
187
  }
168
188
  })
189
+
190
+ // Zoom 및 리렌더링
191
+ setTimeout(() => {
192
+ sciChartSurface.zoomExtents()
193
+ sciChartSurface.invalidateElement()
194
+ }, 200)
169
195
  } catch (error) {
170
- console.log(error)
196
+ console.error('Error updating data series:', error)
171
197
  }
172
-
173
- sciChartSurface.zoomExtents()
174
- sciChartSurface.invalidateElement()
175
198
  })
176
199
 
177
200
  try {
201
+ // Overview 차트 데이터 업데이트
178
202
  this.overviewDataSeries.forEach(ds => ds.clear())
179
203
 
180
204
  newData.forEach((data, index) => {
@@ -188,11 +212,8 @@ export class OxSciChartMultiple extends LitElement {
188
212
  }
189
213
  }
190
214
  })
191
-
192
- this.overviewChart?.sciChartSurface.zoomExtents()
193
- this.overviewChart?.sciChartSurface.invalidateElement()
194
215
  } catch (error) {
195
- console.log(error)
216
+ console.error('Error updating overview data series:', error)
196
217
  }
197
218
  }
198
219
 
@@ -232,7 +253,7 @@ export class OxSciChartMultiple extends LitElement {
232
253
  return html`
233
254
  <div id=${this.containerId + '-overview'} class="overview" ?hidden=${!this.showOverview}></div>
234
255
  <div id="chart-group">
235
- ${datasets.map(({ dataKey }) =>
256
+ ${this.visibleSeries.map(dataKey =>
236
257
  keyed(
237
258
  dataKey,
238
259
  html`
@@ -289,30 +310,29 @@ export class OxSciChartMultiple extends LitElement {
289
310
 
290
311
  const { data = {}, options = {} } = this.config || {}
291
312
  const { datasets = [] } = data as OperatoChart.ChartData
292
- const dataset = datasets.find(dataset => dataset.dataKey == dataKey)
313
+ const primaryDataset = datasets.find(dataset => dataset.dataKey == dataKey)
293
314
 
294
- if (!dataset) {
315
+ if (!primaryDataset) {
295
316
  return
296
317
  }
297
318
 
298
- const { scales } = options
299
- const { yAxes = [] } = scales || {}
300
- const { valueFormat } = dataset
319
+ // 해당 dataKey로 시작하는 모든 시리즈를 함께 그룹화하여 차트를 구성
320
+ const relatedDatasets = datasets.filter(dataset => dataset.dataKey?.startsWith(dataKey))
301
321
 
302
322
  const yAxis = {
303
- ...yAxes[0],
304
- axisTitle: dataset?.label
323
+ ...options.scales?.yAxes?.[0],
324
+ axisTitle: primaryDataset?.label
305
325
  }
306
326
 
307
327
  const config = {
308
328
  ...this.config,
309
329
  data: {
310
- datasets: [dataset]
330
+ datasets: relatedDatasets // 이 차트에 포함될 모든 관련 시리즈들
311
331
  },
312
332
  options: {
313
333
  ...options,
314
334
  scales: {
315
- ...scales,
335
+ ...options.scales,
316
336
  yAxes: [yAxis]
317
337
  }
318
338
  }
@@ -323,13 +343,16 @@ export class OxSciChartMultiple extends LitElement {
323
343
  config,
324
344
  container,
325
345
  { fontSize: 14, fontFamily: 'Roboto', fontColor: undefined },
326
- { precision: valueFormat ? calculatePrecision(valueFormat) : undefined, grouped: this.containerId }
346
+ {
347
+ precision: primaryDataset.valueFormat ? calculatePrecision(primaryDataset.valueFormat) : undefined,
348
+ grouped: this.containerId
349
+ }
327
350
  ))!
328
351
 
329
352
  this.verticalGroup.addSurfaceToGroup(chart.sciChartSurface)
330
353
  this.synchronizer.addAxis(chart.sciChartSurface.xAxes.get(0))
331
354
 
332
- groupedChart.dataKey = config.data.datasets[0]!.dataKey!
355
+ groupedChart.dataKey = primaryDataset.dataKey!
333
356
  groupedChart.sciChartSurface = chart.sciChartSurface
334
357
  groupedChart.dataSeries = dataSeries
335
358
 
@@ -71,7 +71,9 @@ export class OxSciChart extends LitElement {
71
71
  }
72
72
 
73
73
  updateDataSeries() {
74
- if (!this.dataSeries?.length) return
74
+ if (!this.dataSeries?.length) {
75
+ return
76
+ }
75
77
 
76
78
  this.dataSeries.forEach(ds => ds.clear())
77
79
  const newData = this.dataSet
@@ -87,8 +89,10 @@ export class OxSciChart extends LitElement {
87
89
  }
88
90
  })
89
91
 
90
- this.chart?.sciChartSurface.zoomExtents()
91
- this.chart?.sciChartSurface.invalidateElement()
92
+ setTimeout(() => {
93
+ this.chart?.sciChartSurface.zoomExtents()
94
+ this.chart?.sciChartSurface.invalidateElement()
95
+ }, 200)
92
96
  }
93
97
 
94
98
  get dataSet(): { xValue: number; yValue: number }[][] {
@@ -44,7 +44,8 @@ import {
44
44
  HorizontalLineAnnotation,
45
45
  VerticalLineAnnotation,
46
46
  OverviewRangeSelectionModifier,
47
- ENumericFormat
47
+ ENumericFormat,
48
+ XySeriesInfo
48
49
  } from 'scichart'
49
50
  import { AxisSynchroniser } from './axis-synchronizer'
50
51
 
@@ -139,12 +140,12 @@ function createAxis(
139
140
  beginAtZero,
140
141
  color = fontColor,
141
142
  textStrokeColor = fontColor,
142
- display
143
+ display = false
143
144
  } = ticks || {}
144
145
 
145
146
  const axisOptions = {
146
147
  axisTitle,
147
- autoRange: autoMin || autoMax ? EAutoRange.Always : undefined,
148
+ autoRange: autoMin || autoMax ? EAutoRange.Always : EAutoRange.Once,
148
149
  axisAlignment: isXAxis ? EAxisAlignment.Bottom : index === 0 ? EAxisAlignment.Left : EAxisAlignment.Right,
149
150
  visibleRange: min !== undefined && max !== undefined ? new NumberRange(min, max) : undefined,
150
151
  majorDelta: stepSize,
@@ -159,7 +160,8 @@ function createAxis(
159
160
  fontSize,
160
161
  color: textStrokeColor
161
162
  },
162
- ...options
163
+ ...options,
164
+ drawLabels: display
163
165
  }
164
166
 
165
167
  const labelProvider = isXAxis
@@ -171,11 +173,11 @@ function createAxis(
171
173
  : new NumericLabelProvider()
172
174
 
173
175
  if (isXAxis) {
174
- labelProvider.cursorNumericFormat = ENumericFormat.Date_HHMMSS
176
+ labelProvider!.cursorNumericFormat = ENumericFormat.Date_HHMMSS
175
177
  } else {
176
- labelProvider.numericFormat = ENumericFormat.Decimal
177
- labelProvider.precision = precision || calculatePrecision(stepSize || 0.1)
178
- labelProvider.cursorNumericFormat = ENumericFormat.NoFormat
178
+ labelProvider!.numericFormat = ENumericFormat.Decimal
179
+ labelProvider!.precision = precision || calculatePrecision(stepSize || 0.1)
180
+ labelProvider!.cursorNumericFormat = ENumericFormat.NoFormat
179
181
  }
180
182
 
181
183
  return isXAxis
@@ -274,8 +276,8 @@ export async function buildSciChart(
274
276
  position: 'top'
275
277
  },
276
278
  scales: fromScales,
277
- xGridLine = true,
278
- yGridLine = true,
279
+ xGridLine = false,
280
+ yGridLine = false,
279
281
  y2ndGridLine = false,
280
282
  stacked = false,
281
283
  multiAxis = false,
@@ -297,19 +299,25 @@ export async function buildSciChart(
297
299
  })
298
300
  const { sciChartSurface, wasmContext } = chart
299
301
 
300
- // X 축 설정
301
302
  xAxes.forEach((axis, index) => {
302
- const xAxis = createAxis(wasmContext, axis, index, true, fontColor, fontFamily, fontSize)
303
+ const xAxis = createAxis(wasmContext, axis, index, true, fontColor, fontFamily, fontSize, undefined, {
304
+ drawMajorTickLines: true,
305
+ drawMinorTickLines: true,
306
+ drawMajorGridLines: xGridLine,
307
+ drawMinorGridLines: xGridLine
308
+ })
303
309
  sciChartSurface.xAxes.add(xAxis)
304
310
  })
305
-
306
- // Y 축 설정
307
311
  ;(multiAxis ? yAxes : [yAxes[0]]).forEach((axis, index) => {
308
- const yAxis = createAxis(wasmContext, axis, index, false, fontColor, fontFamily, fontSize, precision)
312
+ const yAxis = createAxis(wasmContext, axis, index, false, fontColor, fontFamily, fontSize, precision, {
313
+ drawMajorTickLines: true,
314
+ drawMinorTickLines: true,
315
+ drawMajorGridLines: index == 0 ? yGridLine : y2ndGridLine,
316
+ drawMinorGridLines: index == 0 ? yGridLine : y2ndGridLine
317
+ })
309
318
  sciChartSurface.yAxes.add(yAxis)
310
319
  })
311
320
 
312
- // 시리즈 설정
313
321
  const dataSeriesArray = datasets.map((dataset, index) => {
314
322
  const yAxisId = dataset.yAxisID == 'right' && multiAxis ? 'yAxis1' : undefined
315
323
  const { series, dataSeries } = createSeries(wasmContext, dataset, index, !!stacked, !!animation, yAxisId)
@@ -319,8 +327,14 @@ export async function buildSciChart(
319
327
  if (tooltip) {
320
328
  const rolloverModifier = new RolloverModifier({
321
329
  showTooltip: true,
322
- showAxisLabel: true /* 한글의 크기를 계산하지 못하므로 false */,
323
- modifierGroup: grouped
330
+ showAxisLabel: true /* show x-axis label for cursor */,
331
+ modifierGroup: grouped,
332
+ tooltipDataTemplate: (seriesInfo: XySeriesInfo): string[] => {
333
+ const valuesWithLabels: string[] = []
334
+ const xySeriesInfo = seriesInfo as XySeriesInfo
335
+ valuesWithLabels.push(xySeriesInfo.formattedYValue)
336
+ return valuesWithLabels
337
+ }
324
338
  })
325
339
 
326
340
  sciChartSurface.chartModifiers.add(rolloverModifier)
@@ -329,7 +343,6 @@ export async function buildSciChart(
329
343
  return dataSeries
330
344
  })
331
345
 
332
- // Stacked collections 추가
333
346
  if (stacked) {
334
347
  const stackedColumnCollection = new StackedColumnCollection(wasmContext)
335
348
  const stackedMountainCollection = new StackedMountainCollection(wasmContext)
@@ -434,11 +447,10 @@ export async function buildSciChart(
434
447
  })
435
448
  }
436
449
 
437
- // 줌인/줌아웃 모디파이어 추가
438
450
  sciChartSurface.chartModifiers.add(
439
451
  new RubberBandXyZoomModifier({ executeOn: EExecuteOn.MouseRightButton, modifierGroup: grouped }),
440
452
  // new ZoomPanModifier({ xyDirection: EXyDirection.XDirection }),
441
- new ZoomPanModifier(),
453
+ new ZoomPanModifier({ xyDirection: EXyDirection.XDirection }),
442
454
  new MouseWheelZoomModifier({ xyDirection: EXyDirection.XDirection }),
443
455
  new ZoomExtentsModifier(),
444
456
  new XAxisDragModifier(),
@@ -488,32 +500,53 @@ export async function buildSciChartOverview(
488
500
 
489
501
  const { xAxes = [], yAxes = [] } = fromScales || {}
490
502
 
491
- // Instead we create a normal chart and then manually add the OverviewRangeSelectionModifier and bind it to the axisSynchroniser
492
503
  const chart = await SciChartSurface.create(container, {
493
504
  theme: theme == 'dark' ? new SciChartJSDarkv2Theme() : new SciChartJSLightTheme()
494
505
  })
495
506
  const { sciChartSurface, wasmContext } = chart
496
507
 
497
- // X 축 설정
498
508
  xAxes.forEach((axis, index) => {
499
- const xAxis = createAxis(wasmContext, axis, index, true, fontColor, fontFamily, fontSize)
509
+ const xAxis = createAxis(wasmContext, axis, index, true, fontColor, fontFamily, fontSize, undefined, {
510
+ drawMajorTickLines: false,
511
+ drawMinorTickLines: false,
512
+ drawMajorGridLines: false,
513
+ drawMinorGridLines: false
514
+ })
500
515
  sciChartSurface.xAxes.add(xAxis)
501
516
  })
502
517
 
503
- // Y 설정
504
- ;(multiAxis ? yAxes : [yAxes[0]]).forEach((axis, index) => {
505
- const yAxis = createAxis(wasmContext, axis, index, false, fontColor, fontFamily, fontSize, undefined, {
518
+ const dataSeriesArray = datasets.map((dataset, index) => {
519
+ const yAxisId = `yAxis${index}`
520
+ const dataSeries = new XyDataSeries(wasmContext, {
521
+ dataSeriesName: dataset.label,
522
+ containsNaN: false
523
+ })
524
+
525
+ const yAxis = new NumericAxis(wasmContext, {
526
+ id: yAxisId,
527
+ autoRange: EAutoRange.Always,
506
528
  drawLabels: false,
507
- drawMajorTicks: false,
508
- drawMinorTicks: false,
529
+ drawMajorTickLines: false,
530
+ drawMinorTickLines: false,
509
531
  drawMajorGridLines: false,
510
532
  drawMinorGridLines: false
511
533
  })
534
+
512
535
  sciChartSurface.yAxes.add(yAxis)
536
+
537
+ const series = new FastLineRenderableSeries(wasmContext, {
538
+ dataSeries,
539
+ strokeThickness: 1,
540
+ stroke: convertColor(dataset.color, DEFAULT_COLOR),
541
+ yAxisId: yAxisId
542
+ })
543
+
544
+ sciChartSurface.renderableSeries.add(series)
545
+
546
+ return dataSeries
513
547
  })
514
548
 
515
549
  const rangeSelectionModifier = new OverviewRangeSelectionModifier()
516
- // When the range selection is moved, updated the linked charts
517
550
  rangeSelectionModifier.onSelectedAreaChanged = (selectedRange?: NumberRange) => {
518
551
  if (!selectedRange!.equals(axisSynchroniser.visibleRange)) {
519
552
  axisSynchroniser.publishChange({ visibleRange: selectedRange! })
@@ -523,7 +556,6 @@ export async function buildSciChartOverview(
523
556
  rangeSelectionModifier.selectedArea = axisSynchroniser.visibleRange
524
557
  sciChartSurface.chartModifiers.add(rangeSelectionModifier)
525
558
 
526
- // When charts are moved, update the range selection
527
559
  axisSynchroniser.visibleRangeChanged.subscribe(({ visibleRange }: any) => {
528
560
  const updatedSelectedRange = visibleRange.clip(sciChartSurface.xAxes.get(0).visibleRange)
529
561
  const shouldUpdateSelectedRange = !updatedSelectedRange.equals(rangeSelectionModifier.selectedArea)
@@ -532,13 +564,5 @@ export async function buildSciChartOverview(
532
564
  }
533
565
  })
534
566
 
535
- const dataSeriesArray = datasets.map((dataset, index) => {
536
- const yAxisId = dataset.yAxisID == 'right' && multiAxis ? 'yAxis1' : undefined
537
- const { series, dataSeries } = createSeries(wasmContext, dataset, index, !!stacked, !!animation, yAxisId)
538
-
539
- sciChartSurface.renderableSeries.add(series)
540
- return dataSeries
541
- })
542
-
543
567
  return { chart, dataSeries: dataSeriesArray }
544
568
  }