@opsnow-mcp/opsnow-mcp-common-ui-server 1.0.42 → 1.0.44
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.
|
@@ -171,7 +171,7 @@ export const PieChartExamples = [
|
|
|
171
171
|
},
|
|
172
172
|
label: {
|
|
173
173
|
fontSize: 15,
|
|
174
|
-
text: '[bold fontSize:30px]4.56[/]
|
|
174
|
+
text: '[bold fontSize:30px]4.56[/]\\n[fontSize:18px]total[/]',
|
|
175
175
|
},
|
|
176
176
|
series: {
|
|
177
177
|
valueField: 'cost',
|
|
@@ -244,7 +244,7 @@ export const PieChartExamples = [
|
|
|
244
244
|
},
|
|
245
245
|
label: {
|
|
246
246
|
fontSize: 15,
|
|
247
|
-
text: '[bold fontSize:30px]4.56[/]
|
|
247
|
+
text: '[bold fontSize:30px]4.56[/]\\n[fontSize:18px]total[/]',
|
|
248
248
|
},
|
|
249
249
|
series: {
|
|
250
250
|
valueField: 'cost',
|
|
@@ -746,6 +746,74 @@ export const BarChartExamples = [
|
|
|
746
746
|
onChartClick={selectItem}
|
|
747
747
|
/>`
|
|
748
748
|
},
|
|
749
|
+
{
|
|
750
|
+
title: '바 차트 - 클릭한 막대 색상 강조 (columns.click: clickColor / unClickColor / defaultPosition)',
|
|
751
|
+
description: '바 차트 - 클릭한 막대만 강조 색으로, 나머지는 회색으로 칠하는 예제입니다. series.columns.click 에 clickColor·unClickColor 를 주고, defaultPosition: "end" 로 처음에 마지막 막대를 선택 상태로 둡니다. 카테고리가 1개인 차트에서 사용합니다.',
|
|
752
|
+
code_props_usage: `
|
|
753
|
+
const chartId = 'bar-chart-${generateUniqueGeneralId()}'
|
|
754
|
+
const chartRef = useRef(null)
|
|
755
|
+
const [chartProps, setChartProps] = useState({
|
|
756
|
+
xAxis: {
|
|
757
|
+
type: 'date',
|
|
758
|
+
baseInterval: {
|
|
759
|
+
timeUnit: 'day',
|
|
760
|
+
count: 1
|
|
761
|
+
},
|
|
762
|
+
gridHidden: true
|
|
763
|
+
},
|
|
764
|
+
yAxis: {
|
|
765
|
+
type: 'value'
|
|
766
|
+
},
|
|
767
|
+
series: {
|
|
768
|
+
valueXField: 'date',
|
|
769
|
+
fill: '#B0B6BD',
|
|
770
|
+
cursorOverStyle: 'pointer',
|
|
771
|
+
dataProcessor: {
|
|
772
|
+
dateFields: ['date'],
|
|
773
|
+
dateFormat: 'yyyy-MM-dd'
|
|
774
|
+
},
|
|
775
|
+
columns: {
|
|
776
|
+
width: 'p50',
|
|
777
|
+
click: {
|
|
778
|
+
unClickColor: '#B0B6BD', // 선택되지 않은 막대 색상
|
|
779
|
+
clickColor: '#086CE8', // 클릭(선택)된 막대 색상
|
|
780
|
+
defaultPosition: 'end' // 처음에 마지막 막대를 선택 상태로 (생략 시 첫 번째 막대)
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
tooltip: {
|
|
784
|
+
type: 'CI',
|
|
785
|
+
body: {
|
|
786
|
+
name: '{name}',
|
|
787
|
+
value: '\${valueY.formatNumber("0.00")}',
|
|
788
|
+
useMarker: true
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
},
|
|
792
|
+
legend: {
|
|
793
|
+
useExtension: false
|
|
794
|
+
}
|
|
795
|
+
})
|
|
796
|
+
const [chartData, setChartData] = useState([
|
|
797
|
+
{ 'date': '2023-02-25', 'chartValue': 800 },
|
|
798
|
+
{ 'date': '2023-02-26', 'chartValue': 900 },
|
|
799
|
+
{ 'date': '2023-02-27', 'chartValue': 1000 },
|
|
800
|
+
{ 'date': '2023-02-28', 'chartValue': 1100 }
|
|
801
|
+
])
|
|
802
|
+
const [chartCategory, setChartCategory] = useState(['chartValue'])
|
|
803
|
+
|
|
804
|
+
const selectItem = (obj) => {
|
|
805
|
+
console.log(obj)
|
|
806
|
+
}
|
|
807
|
+
`,
|
|
808
|
+
code: `<OpsnowCommonBarChart
|
|
809
|
+
chartId={chartId}
|
|
810
|
+
ref={chartRef}
|
|
811
|
+
chartProps={chartProps}
|
|
812
|
+
chartData={chartData}
|
|
813
|
+
chartCategory={chartCategory}
|
|
814
|
+
onChartClick={selectItem}
|
|
815
|
+
/>`
|
|
816
|
+
},
|
|
749
817
|
{
|
|
750
818
|
title: '바 차트 - Group Tooltip',
|
|
751
819
|
description: '바 차트 - 그룹 툴팁 데이터 예제입니다.',
|
|
@@ -1930,7 +1998,7 @@ export const LineChartExamples = [
|
|
|
1930
1998
|
}
|
|
1931
1999
|
])
|
|
1932
2000
|
const selectItem = (obj) => {
|
|
1933
|
-
window.alert('clicked
|
|
2001
|
+
window.alert('clicked!!\\n' + JSON.stringify(obj))
|
|
1934
2002
|
}
|
|
1935
2003
|
`,
|
|
1936
2004
|
code: `<OpsnowCommonLineChart
|
|
@@ -2021,7 +2089,7 @@ export const LineChartExamples = [
|
|
|
2021
2089
|
const calcSum = (obj) => {
|
|
2022
2090
|
let sum = 0
|
|
2023
2091
|
for (const p in obj) {
|
|
2024
|
-
if (
|
|
2092
|
+
if (chartCategory.includes(p)) {
|
|
2025
2093
|
sum += Math.floor(obj[p] * 100) / 100
|
|
2026
2094
|
}
|
|
2027
2095
|
}
|
|
@@ -2039,7 +2107,7 @@ export const LineChartExamples = [
|
|
|
2039
2107
|
const total = calcSum(obj)
|
|
2040
2108
|
const result = {sum: '100.00'}
|
|
2041
2109
|
for (const p in obj) {
|
|
2042
|
-
if (
|
|
2110
|
+
if (chartCategory.includes(p)) {
|
|
2043
2111
|
const v = Math.floor(obj[p] * 100) / 100
|
|
2044
2112
|
const ratio = v / total * 100
|
|
2045
2113
|
result[p] = ratio
|
|
@@ -2935,19 +3003,19 @@ export const StackChartExamples = [
|
|
|
2935
3003
|
])
|
|
2936
3004
|
|
|
2937
3005
|
const udfSum = (obj) => {
|
|
2938
|
-
const data =
|
|
3006
|
+
const data = chartData.filter(d => d.productType === obj.productType)[0]
|
|
2939
3007
|
const sum = Object.keys(data)
|
|
2940
|
-
.filter(k =>
|
|
3008
|
+
.filter(k => chartCategory.includes(k))
|
|
2941
3009
|
.map(k => data[k])
|
|
2942
3010
|
.reduce((a, b) => a + b)
|
|
2943
3011
|
return {sum: sum}
|
|
2944
3012
|
}
|
|
2945
3013
|
|
|
2946
3014
|
const udfData = (obj) => {
|
|
2947
|
-
const filtered =
|
|
3015
|
+
const filtered = chartData.filter(d => d.productType === obj.productType)[0]
|
|
2948
3016
|
const result = {}
|
|
2949
3017
|
Object.keys(filtered).forEach(k => {
|
|
2950
|
-
if (
|
|
3018
|
+
if (chartCategory.includes(k)) {
|
|
2951
3019
|
result[k] = parseInt(filtered[k])
|
|
2952
3020
|
}
|
|
2953
3021
|
})
|
|
@@ -3056,19 +3124,19 @@ export const StackChartExamples = [
|
|
|
3056
3124
|
])
|
|
3057
3125
|
|
|
3058
3126
|
const udfSum = (obj) => {
|
|
3059
|
-
const data =
|
|
3127
|
+
const data = chartData.filter(d => d.productType === obj.productType)[0]
|
|
3060
3128
|
const sum = Object.keys(data)
|
|
3061
|
-
.filter(k =>
|
|
3129
|
+
.filter(k => chartCategory.includes(k))
|
|
3062
3130
|
.map(k => data[k])
|
|
3063
3131
|
.reduce((a, b) => a + b)
|
|
3064
3132
|
return {sum: sum}
|
|
3065
3133
|
}
|
|
3066
3134
|
|
|
3067
3135
|
const udfData = (obj) => {
|
|
3068
|
-
const filtered =
|
|
3136
|
+
const filtered = chartData.filter(d => d.productType === obj.productType)[0]
|
|
3069
3137
|
const result = {}
|
|
3070
3138
|
Object.keys(filtered).forEach(k => {
|
|
3071
|
-
if (
|
|
3139
|
+
if (chartCategory.includes(k)) {
|
|
3072
3140
|
result[k] = parseInt(filtered[k])
|
|
3073
3141
|
}
|
|
3074
3142
|
})
|
|
@@ -3578,6 +3646,100 @@ export const StackChartExamples = [
|
|
|
3578
3646
|
chartCustomCategory={chartCustomCategory}
|
|
3579
3647
|
/>`
|
|
3580
3648
|
},
|
|
3649
|
+
{
|
|
3650
|
+
title: '스택 차트 - 기간 비교 툴팁 (tooltip type CI-Compare, 증감 화살표 색상 up / down / even)',
|
|
3651
|
+
description: "스택 차트 - 조회 기간과 비교 기간 2행을 가로 스택 바로 그리고, 카테고리별 툴팁에 증감 화살표(증가 ↑ 빨강 / 감소 ↓ 초록 / 동일 -)와 증감률을 표시하는 예제입니다. tooltip.type 을 'CI-Compare' 로 두고, header.value 에 chartUserDefinedFunc 가 돌려준 'up' | 'down' | 'even' 단어를 넣으면 공통 컴포넌트가 색상 있는 화살표로 바꿔 그립니다. '↑' 같은 글리프나 색상 마크업은 툴팁에서 색이 적용되지 않습니다.",
|
|
3652
|
+
code_props_usage: `
|
|
3653
|
+
const chartId = 'stack-chart-${generateUniqueGeneralId()}'
|
|
3654
|
+
const chartRef = useRef(null)
|
|
3655
|
+
// ⚠️ CI-Compare 는 chartData 가 정확히 2행이어야 합니다: [0] = 비교 기간, [1] = 조회 기간
|
|
3656
|
+
const [chartData, setChartData] = useState([
|
|
3657
|
+
{ 'period': '2023-05', 'Amazon EC2': 8000, 'Amazon RDS': 5000, 'Amazon S3': 2000 },
|
|
3658
|
+
{ 'period': '2023-06', 'Amazon EC2': 10000, 'Amazon RDS': 4000, 'Amazon S3': 2000 }
|
|
3659
|
+
])
|
|
3660
|
+
const [chartCategory, setChartCategory] = useState([
|
|
3661
|
+
'Amazon EC2',
|
|
3662
|
+
'Amazon RDS',
|
|
3663
|
+
'Amazon S3'
|
|
3664
|
+
])
|
|
3665
|
+
const [chartProps, setChartProps] = useState({
|
|
3666
|
+
xAxis: {
|
|
3667
|
+
type: 'value',
|
|
3668
|
+
gridHidden: true
|
|
3669
|
+
},
|
|
3670
|
+
yAxis: {
|
|
3671
|
+
type: 'category',
|
|
3672
|
+
valueField: 'period',
|
|
3673
|
+
gridHidden: true,
|
|
3674
|
+
tooltip: {}
|
|
3675
|
+
},
|
|
3676
|
+
series: {
|
|
3677
|
+
valueYField: 'period',
|
|
3678
|
+
columns: {
|
|
3679
|
+
height: 'p50',
|
|
3680
|
+
hover: {
|
|
3681
|
+
enabled: true,
|
|
3682
|
+
grouped: false
|
|
3683
|
+
}
|
|
3684
|
+
},
|
|
3685
|
+
tooltip: {
|
|
3686
|
+
type: 'CI-Compare',
|
|
3687
|
+
withinArea: true,
|
|
3688
|
+
header: {
|
|
3689
|
+
name: '{name}',
|
|
3690
|
+
// arrow 자리에 'up' | 'down' | 'even' 단어가 오면 공통 컴포넌트가 색상 있는 증감 화살표로 바꿔 그림
|
|
3691
|
+
value: '{customValueTooltip["arrow"]} {customValueTooltip["diffRatio"]}% (\${customValueTooltip["diff"]})'
|
|
3692
|
+
},
|
|
3693
|
+
body: {
|
|
3694
|
+
// 2줄로 표시됨: 조회 기간 행 / 비교 기간 행(빗금 마커)
|
|
3695
|
+
name: '{valueY}',
|
|
3696
|
+
value: '\${customValueTooltip["value"]}',
|
|
3697
|
+
useMarker: true
|
|
3698
|
+
}
|
|
3699
|
+
}
|
|
3700
|
+
},
|
|
3701
|
+
legend: {
|
|
3702
|
+
useExtension: false
|
|
3703
|
+
}
|
|
3704
|
+
})
|
|
3705
|
+
|
|
3706
|
+
// 카테고리별로 { arrow, diffRatio, diff, value } 를 돌려주는 사용자 정의 함수
|
|
3707
|
+
// obj = 마우스를 올린(또는 body 에 그려지는) 행 데이터
|
|
3708
|
+
const customValueTooltip = (obj) => {
|
|
3709
|
+
const compareRow = chartData[0] // 비교 기간
|
|
3710
|
+
const originRow = chartData[1] // 조회 기간
|
|
3711
|
+
const hoveredRow = chartData.find(d => d.period === obj.period) || {}
|
|
3712
|
+
const format = (v) => Number(v || 0).toLocaleString('en-US', { maximumFractionDigits: 2 })
|
|
3713
|
+
const result = {}
|
|
3714
|
+
chartCategory.forEach(c => {
|
|
3715
|
+
const cmp = compareRow[c] || 0
|
|
3716
|
+
const org = originRow[c] || 0
|
|
3717
|
+
const ratio = cmp === 0 ? (org === 0 ? 0 : 100) : ((org - cmp) / cmp) * 100
|
|
3718
|
+
result[c] = {
|
|
3719
|
+
arrow: org > cmp ? 'up' : org < cmp ? 'down' : 'even', // 반드시 up / down / even 단어
|
|
3720
|
+
diffRatio: Math.abs(ratio).toFixed(1),
|
|
3721
|
+
diff: format(Math.abs(org - cmp)),
|
|
3722
|
+
value: format(hoveredRow[c])
|
|
3723
|
+
}
|
|
3724
|
+
})
|
|
3725
|
+
return result
|
|
3726
|
+
}
|
|
3727
|
+
|
|
3728
|
+
const udf = () => {
|
|
3729
|
+
return {
|
|
3730
|
+
customValueTooltip: customValueTooltip
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
`,
|
|
3734
|
+
code: `<OpsnowCommonStackChart
|
|
3735
|
+
chartId={chartId}
|
|
3736
|
+
ref={chartRef}
|
|
3737
|
+
chartProps={chartProps}
|
|
3738
|
+
chartData={chartData}
|
|
3739
|
+
chartCategory={chartCategory}
|
|
3740
|
+
chartUserDefinedFunc={udf()}
|
|
3741
|
+
/>`
|
|
3742
|
+
},
|
|
3581
3743
|
{
|
|
3582
3744
|
title: '스택 차트 - 다운로드',
|
|
3583
3745
|
description: 'ref를 사용하여 스택 차트를 다양한 형식으로 다운로드하는 예제입니다. 차트 ref는 ref prop으로 넘깁니다(chartRef라는 prop은 없음). downloadFile(fileName, fileType, fileOption?)을 호출합니다.',
|
|
@@ -4566,7 +4728,7 @@ export const XyMultiChartExamples = [
|
|
|
4566
4728
|
},
|
|
4567
4729
|
])
|
|
4568
4730
|
const selectItem = (obj) => {
|
|
4569
|
-
window.alert('clicked
|
|
4731
|
+
window.alert('clicked!!\\n' + JSON.stringify(obj))
|
|
4570
4732
|
}
|
|
4571
4733
|
`,
|
|
4572
4734
|
code: `<OpsnowCommonXyMultiChart
|
|
@@ -4844,8 +5006,8 @@ export const XyMultiChartExamples = [
|
|
|
4844
5006
|
/>`
|
|
4845
5007
|
},
|
|
4846
5008
|
{
|
|
4847
|
-
title: 'XY 멀티 차트 - Compare Item + Pointerover Event',
|
|
4848
|
-
description:
|
|
5009
|
+
title: 'XY 멀티 차트 - 기간 비교 툴팁 (tooltip type CG-Compare, 증감률·증감 화살표 색상) + Compare Item + Pointerover Event',
|
|
5010
|
+
description: "XY 멀티 차트 - 조회 기간 vs 비교 기간을 나란히 그리고, 툴팁에 증감률과 증감 화살표(증가 ↑ 빨강 / 감소 ↓ 초록)를 자동 표시하는 예제입니다. tooltip.type 을 'CG-Compare' 로 두고 비교 그룹 chartCategory 에 compare: { origin, matchingType: 'index', valueXField } 를 지정합니다. body·footer value 에는 금액만 넘깁니다 (증감률은 공통 컴포넌트가 계산).",
|
|
4849
5011
|
code_props_usage: `
|
|
4850
5012
|
const chartId = 'xy-multi-chart-${generateUniqueGeneralId()}'
|
|
4851
5013
|
const chartRef = useRef(null)
|
|
@@ -4953,7 +5115,7 @@ export const XyMultiChartExamples = [
|
|
|
4953
5115
|
}
|
|
4954
5116
|
])
|
|
4955
5117
|
const seriesPointerOver = (obj) => {
|
|
4956
|
-
console.log('hovered
|
|
5118
|
+
console.log('hovered!!\\n' + JSON.stringify(obj))
|
|
4957
5119
|
}
|
|
4958
5120
|
`,
|
|
4959
5121
|
code: `<OpsnowCommonXyMultiChart
|
|
@@ -4962,12 +5124,12 @@ export const XyMultiChartExamples = [
|
|
|
4962
5124
|
chartProps={chartProps}
|
|
4963
5125
|
chartData={chartData}
|
|
4964
5126
|
chartCategory={chartCategory}
|
|
4965
|
-
onSeriesPointerOver={
|
|
5127
|
+
onSeriesPointerOver={seriesPointerOver}
|
|
4966
5128
|
/>`
|
|
4967
5129
|
},
|
|
4968
5130
|
{
|
|
4969
|
-
title: 'XY 멀티 차트 - Compare Item + Line Series',
|
|
4970
|
-
description:
|
|
5131
|
+
title: 'XY 멀티 차트 - 기간 비교 툴팁 (tooltip type CG-Compare, 증감률·증감 화살표 색상) + Compare Item + Line Series',
|
|
5132
|
+
description: "XY 멀티 차트 - 라인 시리즈로 조회 기간 vs 비교 기간을 그리고, 툴팁에 증감률과 증감 화살표(증가 ↑ 빨강 / 감소 ↓ 초록)를 자동 표시하는 예제입니다. tooltip.type 'CG-Compare' + 비교 그룹 chartCategory 의 compare 설정을 함께 사용합니다.",
|
|
4971
5133
|
code_props_usage: `
|
|
4972
5134
|
const chartId = 'xy-multi-chart-${generateUniqueGeneralId()}'
|
|
4973
5135
|
const chartRef = useRef(null)
|
|
@@ -6553,6 +6715,845 @@ export const XyMultiChartExamples = [
|
|
|
6553
6715
|
chartCustomCategory={chartCustomCategory}
|
|
6554
6716
|
/>`
|
|
6555
6717
|
},
|
|
6718
|
+
{
|
|
6719
|
+
title: 'XY 멀티 차트 - Zoom / Scroll: Scrollbar X (X축 스크롤바로 구간 이동·확대)',
|
|
6720
|
+
description: 'XY 멀티 차트 - X축 스크롤바(chart.scrollbarX)로 보이는 날짜 구간을 좁히거나 이동하는 예제입니다. zoomOutButtonHidden: false 로 줌 아웃 버튼을 노출합니다.',
|
|
6721
|
+
code_props_usage: `
|
|
6722
|
+
const chartId = 'xy-multi-chart-${generateUniqueGeneralId()}'
|
|
6723
|
+
const chartRef = useRef(null)
|
|
6724
|
+
const [chartProps, setChartProps] = useState({
|
|
6725
|
+
chart: {
|
|
6726
|
+
zoomOutButtonHidden: false,
|
|
6727
|
+
scrollbarX: {},
|
|
6728
|
+
},
|
|
6729
|
+
xAxis: {
|
|
6730
|
+
type: 'date',
|
|
6731
|
+
valueField: 'date',
|
|
6732
|
+
baseInterval: {
|
|
6733
|
+
timeUnit: 'day',
|
|
6734
|
+
count: 1,
|
|
6735
|
+
},
|
|
6736
|
+
gridHidden: true,
|
|
6737
|
+
startLocation: 1,
|
|
6738
|
+
endLocation: 0,
|
|
6739
|
+
renderer: {
|
|
6740
|
+
minGridDistance: 30,
|
|
6741
|
+
},
|
|
6742
|
+
},
|
|
6743
|
+
yAxis: {
|
|
6744
|
+
type: 'value',
|
|
6745
|
+
strictMinMax: true,
|
|
6746
|
+
},
|
|
6747
|
+
series: {
|
|
6748
|
+
valueXField: 'date',
|
|
6749
|
+
dataProcessor: {
|
|
6750
|
+
dateFields: ['date'],
|
|
6751
|
+
dateFormat: 'yyyy-MM-dd',
|
|
6752
|
+
},
|
|
6753
|
+
seriesTypes: [
|
|
6754
|
+
{
|
|
6755
|
+
type: 'stack-line',
|
|
6756
|
+
categoryGroupName: 'ondemand_cost',
|
|
6757
|
+
lineType: 'smoothedX',
|
|
6758
|
+
bullet: {
|
|
6759
|
+
type: 'circle',
|
|
6760
|
+
lineOnly: true,
|
|
6761
|
+
},
|
|
6762
|
+
},
|
|
6763
|
+
{
|
|
6764
|
+
type: 'stack',
|
|
6765
|
+
categoryGroupName: 'savings_cost',
|
|
6766
|
+
},
|
|
6767
|
+
],
|
|
6768
|
+
tooltip: {
|
|
6769
|
+
type: 'CG',
|
|
6770
|
+
stopActionEnabled: true,
|
|
6771
|
+
header: {
|
|
6772
|
+
name: '{valueX.formatDate("MM/dd")}',
|
|
6773
|
+
},
|
|
6774
|
+
body: {
|
|
6775
|
+
maxRowCount: 10,
|
|
6776
|
+
name: '{name}',
|
|
6777
|
+
value: [
|
|
6778
|
+
{
|
|
6779
|
+
categoryGroupName: 'ondemand_cost',
|
|
6780
|
+
value:
|
|
6781
|
+
'\${valueY.formatNumber("0,0")}({valueYPercent.formatNumber("0.0")}%)',
|
|
6782
|
+
},
|
|
6783
|
+
{
|
|
6784
|
+
categoryGroupName: 'savings_cost',
|
|
6785
|
+
value: '\${valueY.formatNumber("0,0")}',
|
|
6786
|
+
},
|
|
6787
|
+
],
|
|
6788
|
+
useMarker: true,
|
|
6789
|
+
},
|
|
6790
|
+
footer: {
|
|
6791
|
+
name: 'Total',
|
|
6792
|
+
value: [
|
|
6793
|
+
{
|
|
6794
|
+
categoryGroupName: 'ondemand_cost',
|
|
6795
|
+
value: '\${valueYSum.formatNumber("0,0")}(100.0%)',
|
|
6796
|
+
},
|
|
6797
|
+
{
|
|
6798
|
+
categoryGroupName: 'savings_cost',
|
|
6799
|
+
value: '\${valueYSum.formatNumber("0,0")}',
|
|
6800
|
+
},
|
|
6801
|
+
],
|
|
6802
|
+
},
|
|
6803
|
+
},
|
|
6804
|
+
},
|
|
6805
|
+
cursor: {
|
|
6806
|
+
visibleY: false,
|
|
6807
|
+
},
|
|
6808
|
+
legend: {},
|
|
6809
|
+
})
|
|
6810
|
+
const [chartData, setChartData] = useState([
|
|
6811
|
+
{
|
|
6812
|
+
date: '2022-12-01',
|
|
6813
|
+
rds_ondemand_cost: 2000,
|
|
6814
|
+
elasti_cache_ondemand_cost: 2000,
|
|
6815
|
+
red_shift_ondemand_cost: 2000,
|
|
6816
|
+
sage_maker_ondemand_cost: 2000,
|
|
6817
|
+
sp_compute_ondemand_cost: 2000,
|
|
6818
|
+
rds_savings_cost: 200,
|
|
6819
|
+
elasti_cache_savings_cost: 200,
|
|
6820
|
+
red_shift_savings_cost: 200,
|
|
6821
|
+
sage_maker_savings_cost: 200,
|
|
6822
|
+
sp_compute_savings_cost: 10,
|
|
6823
|
+
},
|
|
6824
|
+
{
|
|
6825
|
+
date: '2022-12-02',
|
|
6826
|
+
rds_ondemand_cost: 2200,
|
|
6827
|
+
elasti_cache_ondemand_cost: 2200,
|
|
6828
|
+
red_shift_ondemand_cost: 2200,
|
|
6829
|
+
sage_maker_ondemand_cost: 2200,
|
|
6830
|
+
sp_compute_ondemand_cost: 2000,
|
|
6831
|
+
rds_savings_cost: 400,
|
|
6832
|
+
elasti_cache_savings_cost: 400,
|
|
6833
|
+
red_shift_savings_cost: 400,
|
|
6834
|
+
sage_maker_savings_cost: 400,
|
|
6835
|
+
sp_compute_savings_cost: 400,
|
|
6836
|
+
},
|
|
6837
|
+
{
|
|
6838
|
+
date: '2022-12-03',
|
|
6839
|
+
rds_ondemand_cost: 2400,
|
|
6840
|
+
elasti_cache_ondemand_cost: 2400,
|
|
6841
|
+
red_shift_ondemand_cost: 2400,
|
|
6842
|
+
sage_maker_ondemand_cost: 2400,
|
|
6843
|
+
sp_compute_ondemand_cost: 2400,
|
|
6844
|
+
rds_savings_cost: 400,
|
|
6845
|
+
elasti_cache_savings_cost: 400,
|
|
6846
|
+
red_shift_savings_cost: 400,
|
|
6847
|
+
sage_maker_savings_cost: 400,
|
|
6848
|
+
sp_compute_savings_cost: 400,
|
|
6849
|
+
},
|
|
6850
|
+
{
|
|
6851
|
+
date: '2022-12-04',
|
|
6852
|
+
rds_ondemand_cost: 1600,
|
|
6853
|
+
elasti_cache_ondemand_cost: 1600,
|
|
6854
|
+
red_shift_ondemand_cost: 1600,
|
|
6855
|
+
sage_maker_ondemand_cost: 1600,
|
|
6856
|
+
sp_compute_ondemand_cost: 1600,
|
|
6857
|
+
rds_savings_cost: 800,
|
|
6858
|
+
elasti_cache_savings_cost: 800,
|
|
6859
|
+
red_shift_savings_cost: 800,
|
|
6860
|
+
sage_maker_savings_cost: 800,
|
|
6861
|
+
sp_compute_savings_cost: 800,
|
|
6862
|
+
},
|
|
6863
|
+
{
|
|
6864
|
+
date: '2022-12-05',
|
|
6865
|
+
rds_ondemand_cost: 1800,
|
|
6866
|
+
elasti_cache_ondemand_cost: 1800,
|
|
6867
|
+
red_shift_ondemand_cost: 1800,
|
|
6868
|
+
sage_maker_ondemand_cost: 1800,
|
|
6869
|
+
sp_compute_ondemand_cost: 1800,
|
|
6870
|
+
rds_savings_cost: 800,
|
|
6871
|
+
elasti_cache_savings_cost: 800,
|
|
6872
|
+
red_shift_savings_cost: 800,
|
|
6873
|
+
sage_maker_savings_cost: 800,
|
|
6874
|
+
sp_compute_savings_cost: 800,
|
|
6875
|
+
},
|
|
6876
|
+
{
|
|
6877
|
+
date: '2022-12-06',
|
|
6878
|
+
rds_ondemand_cost: 2000,
|
|
6879
|
+
elasti_cache_ondemand_cost: 2000,
|
|
6880
|
+
red_shift_ondemand_cost: 2000,
|
|
6881
|
+
sage_maker_ondemand_cost: 2000,
|
|
6882
|
+
sp_compute_ondemand_cost: 2000,
|
|
6883
|
+
rds_savings_cost: 600,
|
|
6884
|
+
elasti_cache_savings_cost: 600,
|
|
6885
|
+
red_shift_savings_cost: 600,
|
|
6886
|
+
sage_maker_savings_cost: 600,
|
|
6887
|
+
sp_compute_savings_cost: 600,
|
|
6888
|
+
}
|
|
6889
|
+
// ... 이후 날짜도 같은 형태 (줌/스크롤은 데이터가 많을 때 의미가 있으므로 실제로는 15일치 이상을 넣습니다)
|
|
6890
|
+
])
|
|
6891
|
+
const [chartCategory, setChartCategory] = useState([
|
|
6892
|
+
{
|
|
6893
|
+
name: 'ondemand_cost',
|
|
6894
|
+
categories: [
|
|
6895
|
+
'rds_ondemand_cost',
|
|
6896
|
+
'elasti_cache_ondemand_cost',
|
|
6897
|
+
'red_shift_ondemand_cost',
|
|
6898
|
+
'sage_maker_ondemand_cost',
|
|
6899
|
+
'sp_compute_ondemand_cost',
|
|
6900
|
+
// 'open_search_ondemand_cost',
|
|
6901
|
+
// 'compute_group_ondemand_cost'
|
|
6902
|
+
],
|
|
6903
|
+
},
|
|
6904
|
+
{
|
|
6905
|
+
name: 'savings_cost',
|
|
6906
|
+
categories: [
|
|
6907
|
+
'rds_savings_cost',
|
|
6908
|
+
'elasti_cache_savings_cost',
|
|
6909
|
+
'red_shift_savings_cost',
|
|
6910
|
+
'sage_maker_savings_cost',
|
|
6911
|
+
'sp_compute_savings_cost',
|
|
6912
|
+
// 'open_search_savings_cost',
|
|
6913
|
+
// 'compute_group_savings_cost'
|
|
6914
|
+
],
|
|
6915
|
+
},
|
|
6916
|
+
])
|
|
6917
|
+
`,
|
|
6918
|
+
code: `<OpsnowCommonXyMultiChart
|
|
6919
|
+
chartId={chartId}
|
|
6920
|
+
ref={chartRef}
|
|
6921
|
+
chartProps={chartProps}
|
|
6922
|
+
chartData={chartData}
|
|
6923
|
+
chartCategory={chartCategory}
|
|
6924
|
+
/>`
|
|
6925
|
+
},
|
|
6926
|
+
{
|
|
6927
|
+
title: 'XY 멀티 차트 - Zoom / Scroll: Scrollbar Y (Y축 스크롤바로 값 범위 확대)',
|
|
6928
|
+
description: 'XY 멀티 차트 - Y축 스크롤바(chart.scrollbarY)로 보이는 값 범위를 좁히거나 이동하는 예제입니다.',
|
|
6929
|
+
code_props_usage: `
|
|
6930
|
+
const chartId = 'xy-multi-chart-${generateUniqueGeneralId()}'
|
|
6931
|
+
const chartRef = useRef(null)
|
|
6932
|
+
const [chartProps, setChartProps] = useState({
|
|
6933
|
+
chart: {
|
|
6934
|
+
zoomOutButtonHidden: false,
|
|
6935
|
+
scrollbarY: {},
|
|
6936
|
+
},
|
|
6937
|
+
xAxis: {
|
|
6938
|
+
type: 'date',
|
|
6939
|
+
valueField: 'date',
|
|
6940
|
+
baseInterval: {
|
|
6941
|
+
timeUnit: 'day',
|
|
6942
|
+
count: 1,
|
|
6943
|
+
},
|
|
6944
|
+
gridHidden: true,
|
|
6945
|
+
startLocation: 1,
|
|
6946
|
+
endLocation: 0,
|
|
6947
|
+
renderer: {
|
|
6948
|
+
minGridDistance: 30,
|
|
6949
|
+
},
|
|
6950
|
+
},
|
|
6951
|
+
yAxis: {
|
|
6952
|
+
type: 'value',
|
|
6953
|
+
strictMinMax: true,
|
|
6954
|
+
},
|
|
6955
|
+
series: {
|
|
6956
|
+
valueXField: 'date',
|
|
6957
|
+
dataProcessor: {
|
|
6958
|
+
dateFields: ['date'],
|
|
6959
|
+
dateFormat: 'yyyy-MM-dd',
|
|
6960
|
+
},
|
|
6961
|
+
seriesTypes: [
|
|
6962
|
+
{
|
|
6963
|
+
type: 'stack-line',
|
|
6964
|
+
categoryGroupName: 'ondemand_cost',
|
|
6965
|
+
lineType: 'smoothedX',
|
|
6966
|
+
bullet: {
|
|
6967
|
+
type: 'circle',
|
|
6968
|
+
lineOnly: true,
|
|
6969
|
+
},
|
|
6970
|
+
},
|
|
6971
|
+
{
|
|
6972
|
+
type: 'stack',
|
|
6973
|
+
categoryGroupName: 'savings_cost',
|
|
6974
|
+
},
|
|
6975
|
+
],
|
|
6976
|
+
tooltip: {
|
|
6977
|
+
type: 'CG',
|
|
6978
|
+
stopActionEnabled: true,
|
|
6979
|
+
header: {
|
|
6980
|
+
name: '{valueX.formatDate("MM/dd")}',
|
|
6981
|
+
},
|
|
6982
|
+
body: {
|
|
6983
|
+
maxRowCount: 10,
|
|
6984
|
+
name: '{name}',
|
|
6985
|
+
value: [
|
|
6986
|
+
{
|
|
6987
|
+
categoryGroupName: 'ondemand_cost',
|
|
6988
|
+
value:
|
|
6989
|
+
'\${valueY.formatNumber("0,0")}({valueYPercent.formatNumber("0.0")}%)',
|
|
6990
|
+
},
|
|
6991
|
+
{
|
|
6992
|
+
categoryGroupName: 'savings_cost',
|
|
6993
|
+
value: '\${valueY.formatNumber("0,0")}',
|
|
6994
|
+
},
|
|
6995
|
+
],
|
|
6996
|
+
useMarker: true,
|
|
6997
|
+
},
|
|
6998
|
+
footer: {
|
|
6999
|
+
name: 'Total',
|
|
7000
|
+
value: [
|
|
7001
|
+
{
|
|
7002
|
+
categoryGroupName: 'ondemand_cost',
|
|
7003
|
+
value: '\${valueYSum.formatNumber("0,0")}(100.0%)',
|
|
7004
|
+
},
|
|
7005
|
+
{
|
|
7006
|
+
categoryGroupName: 'savings_cost',
|
|
7007
|
+
value: '\${valueYSum.formatNumber("0,0")}',
|
|
7008
|
+
},
|
|
7009
|
+
],
|
|
7010
|
+
},
|
|
7011
|
+
},
|
|
7012
|
+
},
|
|
7013
|
+
cursor: {
|
|
7014
|
+
visibleY: false,
|
|
7015
|
+
},
|
|
7016
|
+
legend: {},
|
|
7017
|
+
})
|
|
7018
|
+
const [chartData, setChartData] = useState([
|
|
7019
|
+
{
|
|
7020
|
+
date: '2022-12-01',
|
|
7021
|
+
rds_ondemand_cost: 2000,
|
|
7022
|
+
elasti_cache_ondemand_cost: 2000,
|
|
7023
|
+
red_shift_ondemand_cost: 2000,
|
|
7024
|
+
sage_maker_ondemand_cost: 2000,
|
|
7025
|
+
sp_compute_ondemand_cost: 2000,
|
|
7026
|
+
rds_savings_cost: 200,
|
|
7027
|
+
elasti_cache_savings_cost: 200,
|
|
7028
|
+
red_shift_savings_cost: 200,
|
|
7029
|
+
sage_maker_savings_cost: 200,
|
|
7030
|
+
sp_compute_savings_cost: 10,
|
|
7031
|
+
},
|
|
7032
|
+
{
|
|
7033
|
+
date: '2022-12-02',
|
|
7034
|
+
rds_ondemand_cost: 2200,
|
|
7035
|
+
elasti_cache_ondemand_cost: 2200,
|
|
7036
|
+
red_shift_ondemand_cost: 2200,
|
|
7037
|
+
sage_maker_ondemand_cost: 2200,
|
|
7038
|
+
sp_compute_ondemand_cost: 2000,
|
|
7039
|
+
rds_savings_cost: 400,
|
|
7040
|
+
elasti_cache_savings_cost: 400,
|
|
7041
|
+
red_shift_savings_cost: 400,
|
|
7042
|
+
sage_maker_savings_cost: 400,
|
|
7043
|
+
sp_compute_savings_cost: 400,
|
|
7044
|
+
},
|
|
7045
|
+
{
|
|
7046
|
+
date: '2022-12-03',
|
|
7047
|
+
rds_ondemand_cost: 2400,
|
|
7048
|
+
elasti_cache_ondemand_cost: 2400,
|
|
7049
|
+
red_shift_ondemand_cost: 2400,
|
|
7050
|
+
sage_maker_ondemand_cost: 2400,
|
|
7051
|
+
sp_compute_ondemand_cost: 2400,
|
|
7052
|
+
rds_savings_cost: 400,
|
|
7053
|
+
elasti_cache_savings_cost: 400,
|
|
7054
|
+
red_shift_savings_cost: 400,
|
|
7055
|
+
sage_maker_savings_cost: 400,
|
|
7056
|
+
sp_compute_savings_cost: 400,
|
|
7057
|
+
},
|
|
7058
|
+
{
|
|
7059
|
+
date: '2022-12-04',
|
|
7060
|
+
rds_ondemand_cost: 1600,
|
|
7061
|
+
elasti_cache_ondemand_cost: 1600,
|
|
7062
|
+
red_shift_ondemand_cost: 1600,
|
|
7063
|
+
sage_maker_ondemand_cost: 1600,
|
|
7064
|
+
sp_compute_ondemand_cost: 1600,
|
|
7065
|
+
rds_savings_cost: 800,
|
|
7066
|
+
elasti_cache_savings_cost: 800,
|
|
7067
|
+
red_shift_savings_cost: 800,
|
|
7068
|
+
sage_maker_savings_cost: 800,
|
|
7069
|
+
sp_compute_savings_cost: 800,
|
|
7070
|
+
},
|
|
7071
|
+
{
|
|
7072
|
+
date: '2022-12-05',
|
|
7073
|
+
rds_ondemand_cost: 1800,
|
|
7074
|
+
elasti_cache_ondemand_cost: 1800,
|
|
7075
|
+
red_shift_ondemand_cost: 1800,
|
|
7076
|
+
sage_maker_ondemand_cost: 1800,
|
|
7077
|
+
sp_compute_ondemand_cost: 1800,
|
|
7078
|
+
rds_savings_cost: 800,
|
|
7079
|
+
elasti_cache_savings_cost: 800,
|
|
7080
|
+
red_shift_savings_cost: 800,
|
|
7081
|
+
sage_maker_savings_cost: 800,
|
|
7082
|
+
sp_compute_savings_cost: 800,
|
|
7083
|
+
},
|
|
7084
|
+
{
|
|
7085
|
+
date: '2022-12-06',
|
|
7086
|
+
rds_ondemand_cost: 2000,
|
|
7087
|
+
elasti_cache_ondemand_cost: 2000,
|
|
7088
|
+
red_shift_ondemand_cost: 2000,
|
|
7089
|
+
sage_maker_ondemand_cost: 2000,
|
|
7090
|
+
sp_compute_ondemand_cost: 2000,
|
|
7091
|
+
rds_savings_cost: 600,
|
|
7092
|
+
elasti_cache_savings_cost: 600,
|
|
7093
|
+
red_shift_savings_cost: 600,
|
|
7094
|
+
sage_maker_savings_cost: 600,
|
|
7095
|
+
sp_compute_savings_cost: 600,
|
|
7096
|
+
}
|
|
7097
|
+
// ... 이후 날짜도 같은 형태 (줌/스크롤은 데이터가 많을 때 의미가 있으므로 실제로는 15일치 이상을 넣습니다)
|
|
7098
|
+
])
|
|
7099
|
+
const [chartCategory, setChartCategory] = useState([
|
|
7100
|
+
{
|
|
7101
|
+
name: 'ondemand_cost',
|
|
7102
|
+
categories: [
|
|
7103
|
+
'rds_ondemand_cost',
|
|
7104
|
+
'elasti_cache_ondemand_cost',
|
|
7105
|
+
'red_shift_ondemand_cost',
|
|
7106
|
+
'sage_maker_ondemand_cost',
|
|
7107
|
+
'sp_compute_ondemand_cost',
|
|
7108
|
+
// 'open_search_ondemand_cost',
|
|
7109
|
+
// 'compute_group_ondemand_cost'
|
|
7110
|
+
],
|
|
7111
|
+
},
|
|
7112
|
+
{
|
|
7113
|
+
name: 'savings_cost',
|
|
7114
|
+
categories: [
|
|
7115
|
+
'rds_savings_cost',
|
|
7116
|
+
'elasti_cache_savings_cost',
|
|
7117
|
+
'red_shift_savings_cost',
|
|
7118
|
+
'sage_maker_savings_cost',
|
|
7119
|
+
'sp_compute_savings_cost',
|
|
7120
|
+
// 'open_search_savings_cost',
|
|
7121
|
+
// 'compute_group_savings_cost'
|
|
7122
|
+
],
|
|
7123
|
+
},
|
|
7124
|
+
])
|
|
7125
|
+
`,
|
|
7126
|
+
code: `<OpsnowCommonXyMultiChart
|
|
7127
|
+
chartId={chartId}
|
|
7128
|
+
ref={chartRef}
|
|
7129
|
+
chartProps={chartProps}
|
|
7130
|
+
chartData={chartData}
|
|
7131
|
+
chartCategory={chartCategory}
|
|
7132
|
+
/>`
|
|
7133
|
+
},
|
|
7134
|
+
{
|
|
7135
|
+
title: 'XY 멀티 차트 - Zoom / Scroll: Scrollbar X + Y + 드래그 확대 (cursor.behavior zoomXY)',
|
|
7136
|
+
description: 'XY 멀티 차트 - X·Y축 스크롤바를 함께 쓰고, cursor.behavior: "zoomXY" 로 마우스로 드래그한 영역을 확대하는 예제입니다.',
|
|
7137
|
+
code_props_usage: `
|
|
7138
|
+
const chartId = 'xy-multi-chart-${generateUniqueGeneralId()}'
|
|
7139
|
+
const chartRef = useRef(null)
|
|
7140
|
+
const [chartProps, setChartProps] = useState({
|
|
7141
|
+
chart: {
|
|
7142
|
+
zoomOutButtonHidden: false,
|
|
7143
|
+
scrollbarX: {},
|
|
7144
|
+
scrollbarY: {},
|
|
7145
|
+
},
|
|
7146
|
+
xAxis: {
|
|
7147
|
+
type: 'date',
|
|
7148
|
+
valueField: 'date',
|
|
7149
|
+
baseInterval: {
|
|
7150
|
+
timeUnit: 'day',
|
|
7151
|
+
count: 1,
|
|
7152
|
+
},
|
|
7153
|
+
gridHidden: true,
|
|
7154
|
+
startLocation: 1,
|
|
7155
|
+
endLocation: 0,
|
|
7156
|
+
renderer: {
|
|
7157
|
+
minGridDistance: 30,
|
|
7158
|
+
},
|
|
7159
|
+
},
|
|
7160
|
+
yAxis: {
|
|
7161
|
+
type: 'value',
|
|
7162
|
+
strictMinMax: true,
|
|
7163
|
+
},
|
|
7164
|
+
series: {
|
|
7165
|
+
valueXField: 'date',
|
|
7166
|
+
dataProcessor: {
|
|
7167
|
+
dateFields: ['date'],
|
|
7168
|
+
dateFormat: 'yyyy-MM-dd',
|
|
7169
|
+
},
|
|
7170
|
+
seriesTypes: [
|
|
7171
|
+
{
|
|
7172
|
+
type: 'stack-line',
|
|
7173
|
+
categoryGroupName: 'ondemand_cost',
|
|
7174
|
+
lineType: 'smoothedX',
|
|
7175
|
+
bullet: {
|
|
7176
|
+
type: 'circle',
|
|
7177
|
+
lineOnly: true,
|
|
7178
|
+
},
|
|
7179
|
+
},
|
|
7180
|
+
{
|
|
7181
|
+
type: 'stack',
|
|
7182
|
+
categoryGroupName: 'savings_cost',
|
|
7183
|
+
},
|
|
7184
|
+
],
|
|
7185
|
+
tooltip: {
|
|
7186
|
+
type: 'CG',
|
|
7187
|
+
stopActionEnabled: true,
|
|
7188
|
+
header: {
|
|
7189
|
+
name: '{valueX.formatDate("MM/dd")}',
|
|
7190
|
+
},
|
|
7191
|
+
body: {
|
|
7192
|
+
maxRowCount: 10,
|
|
7193
|
+
name: '{name}',
|
|
7194
|
+
value: [
|
|
7195
|
+
{
|
|
7196
|
+
categoryGroupName: 'ondemand_cost',
|
|
7197
|
+
value:
|
|
7198
|
+
'\${valueY.formatNumber("0,0")}({valueYPercent.formatNumber("0.0")}%)',
|
|
7199
|
+
},
|
|
7200
|
+
{
|
|
7201
|
+
categoryGroupName: 'savings_cost',
|
|
7202
|
+
value: '\${valueY.formatNumber("0,0")}',
|
|
7203
|
+
},
|
|
7204
|
+
],
|
|
7205
|
+
useMarker: true,
|
|
7206
|
+
},
|
|
7207
|
+
footer: {
|
|
7208
|
+
name: 'Total',
|
|
7209
|
+
value: [
|
|
7210
|
+
{
|
|
7211
|
+
categoryGroupName: 'ondemand_cost',
|
|
7212
|
+
value: '\${valueYSum.formatNumber("0,0")}(100.0%)',
|
|
7213
|
+
},
|
|
7214
|
+
{
|
|
7215
|
+
categoryGroupName: 'savings_cost',
|
|
7216
|
+
value: '\${valueYSum.formatNumber("0,0")}',
|
|
7217
|
+
},
|
|
7218
|
+
],
|
|
7219
|
+
},
|
|
7220
|
+
},
|
|
7221
|
+
},
|
|
7222
|
+
cursor: {
|
|
7223
|
+
visibleY: false,
|
|
7224
|
+
behavior: 'zoomXY',
|
|
7225
|
+
},
|
|
7226
|
+
legend: {},
|
|
7227
|
+
})
|
|
7228
|
+
const [chartData, setChartData] = useState([
|
|
7229
|
+
{
|
|
7230
|
+
date: '2022-12-01',
|
|
7231
|
+
rds_ondemand_cost: 2000,
|
|
7232
|
+
elasti_cache_ondemand_cost: 2000,
|
|
7233
|
+
red_shift_ondemand_cost: 2000,
|
|
7234
|
+
sage_maker_ondemand_cost: 2000,
|
|
7235
|
+
sp_compute_ondemand_cost: 2000,
|
|
7236
|
+
rds_savings_cost: 200,
|
|
7237
|
+
elasti_cache_savings_cost: 200,
|
|
7238
|
+
red_shift_savings_cost: 200,
|
|
7239
|
+
sage_maker_savings_cost: 200,
|
|
7240
|
+
sp_compute_savings_cost: 10,
|
|
7241
|
+
},
|
|
7242
|
+
{
|
|
7243
|
+
date: '2022-12-02',
|
|
7244
|
+
rds_ondemand_cost: 2200,
|
|
7245
|
+
elasti_cache_ondemand_cost: 2200,
|
|
7246
|
+
red_shift_ondemand_cost: 2200,
|
|
7247
|
+
sage_maker_ondemand_cost: 2200,
|
|
7248
|
+
sp_compute_ondemand_cost: 2000,
|
|
7249
|
+
rds_savings_cost: 400,
|
|
7250
|
+
elasti_cache_savings_cost: 400,
|
|
7251
|
+
red_shift_savings_cost: 400,
|
|
7252
|
+
sage_maker_savings_cost: 400,
|
|
7253
|
+
sp_compute_savings_cost: 400,
|
|
7254
|
+
},
|
|
7255
|
+
{
|
|
7256
|
+
date: '2022-12-03',
|
|
7257
|
+
rds_ondemand_cost: 2400,
|
|
7258
|
+
elasti_cache_ondemand_cost: 2400,
|
|
7259
|
+
red_shift_ondemand_cost: 2400,
|
|
7260
|
+
sage_maker_ondemand_cost: 2400,
|
|
7261
|
+
sp_compute_ondemand_cost: 2400,
|
|
7262
|
+
rds_savings_cost: 400,
|
|
7263
|
+
elasti_cache_savings_cost: 400,
|
|
7264
|
+
red_shift_savings_cost: 400,
|
|
7265
|
+
sage_maker_savings_cost: 400,
|
|
7266
|
+
sp_compute_savings_cost: 400,
|
|
7267
|
+
},
|
|
7268
|
+
{
|
|
7269
|
+
date: '2022-12-04',
|
|
7270
|
+
rds_ondemand_cost: 1600,
|
|
7271
|
+
elasti_cache_ondemand_cost: 1600,
|
|
7272
|
+
red_shift_ondemand_cost: 1600,
|
|
7273
|
+
sage_maker_ondemand_cost: 1600,
|
|
7274
|
+
sp_compute_ondemand_cost: 1600,
|
|
7275
|
+
rds_savings_cost: 800,
|
|
7276
|
+
elasti_cache_savings_cost: 800,
|
|
7277
|
+
red_shift_savings_cost: 800,
|
|
7278
|
+
sage_maker_savings_cost: 800,
|
|
7279
|
+
sp_compute_savings_cost: 800,
|
|
7280
|
+
},
|
|
7281
|
+
{
|
|
7282
|
+
date: '2022-12-05',
|
|
7283
|
+
rds_ondemand_cost: 1800,
|
|
7284
|
+
elasti_cache_ondemand_cost: 1800,
|
|
7285
|
+
red_shift_ondemand_cost: 1800,
|
|
7286
|
+
sage_maker_ondemand_cost: 1800,
|
|
7287
|
+
sp_compute_ondemand_cost: 1800,
|
|
7288
|
+
rds_savings_cost: 800,
|
|
7289
|
+
elasti_cache_savings_cost: 800,
|
|
7290
|
+
red_shift_savings_cost: 800,
|
|
7291
|
+
sage_maker_savings_cost: 800,
|
|
7292
|
+
sp_compute_savings_cost: 800,
|
|
7293
|
+
},
|
|
7294
|
+
{
|
|
7295
|
+
date: '2022-12-06',
|
|
7296
|
+
rds_ondemand_cost: 2000,
|
|
7297
|
+
elasti_cache_ondemand_cost: 2000,
|
|
7298
|
+
red_shift_ondemand_cost: 2000,
|
|
7299
|
+
sage_maker_ondemand_cost: 2000,
|
|
7300
|
+
sp_compute_ondemand_cost: 2000,
|
|
7301
|
+
rds_savings_cost: 600,
|
|
7302
|
+
elasti_cache_savings_cost: 600,
|
|
7303
|
+
red_shift_savings_cost: 600,
|
|
7304
|
+
sage_maker_savings_cost: 600,
|
|
7305
|
+
sp_compute_savings_cost: 600,
|
|
7306
|
+
}
|
|
7307
|
+
// ... 이후 날짜도 같은 형태 (줌/스크롤은 데이터가 많을 때 의미가 있으므로 실제로는 15일치 이상을 넣습니다)
|
|
7308
|
+
])
|
|
7309
|
+
const [chartCategory, setChartCategory] = useState([
|
|
7310
|
+
{
|
|
7311
|
+
name: 'ondemand_cost',
|
|
7312
|
+
categories: [
|
|
7313
|
+
'rds_ondemand_cost',
|
|
7314
|
+
'elasti_cache_ondemand_cost',
|
|
7315
|
+
'red_shift_ondemand_cost',
|
|
7316
|
+
'sage_maker_ondemand_cost',
|
|
7317
|
+
'sp_compute_ondemand_cost',
|
|
7318
|
+
// 'open_search_ondemand_cost',
|
|
7319
|
+
// 'compute_group_ondemand_cost'
|
|
7320
|
+
],
|
|
7321
|
+
},
|
|
7322
|
+
{
|
|
7323
|
+
name: 'savings_cost',
|
|
7324
|
+
categories: [
|
|
7325
|
+
'rds_savings_cost',
|
|
7326
|
+
'elasti_cache_savings_cost',
|
|
7327
|
+
'red_shift_savings_cost',
|
|
7328
|
+
'sage_maker_savings_cost',
|
|
7329
|
+
'sp_compute_savings_cost',
|
|
7330
|
+
// 'open_search_savings_cost',
|
|
7331
|
+
// 'compute_group_savings_cost'
|
|
7332
|
+
],
|
|
7333
|
+
},
|
|
7334
|
+
])
|
|
7335
|
+
`,
|
|
7336
|
+
code: `<OpsnowCommonXyMultiChart
|
|
7337
|
+
chartId={chartId}
|
|
7338
|
+
ref={chartRef}
|
|
7339
|
+
chartProps={chartProps}
|
|
7340
|
+
chartData={chartData}
|
|
7341
|
+
chartCategory={chartCategory}
|
|
7342
|
+
/>`
|
|
7343
|
+
},
|
|
7344
|
+
{
|
|
7345
|
+
title: 'XY 멀티 차트 - Zoom / Scroll: Scrollbar X 시리즈 미리보기 (scrollbarX.showSeries + height)',
|
|
7346
|
+
description: 'XY 멀티 차트 - X축 스크롤바 안에 시리즈 미리보기를 그리는 예제입니다 (scrollbarX: { height: 60, showSeries: true }).',
|
|
7347
|
+
code_props_usage: `
|
|
7348
|
+
const chartId = 'xy-multi-chart-${generateUniqueGeneralId()}'
|
|
7349
|
+
const chartRef = useRef(null)
|
|
7350
|
+
const [chartProps, setChartProps] = useState({
|
|
7351
|
+
chart: {
|
|
7352
|
+
zoomOutButtonHidden: false,
|
|
7353
|
+
scrollbarX: {
|
|
7354
|
+
height: 60,
|
|
7355
|
+
showSeries: true,
|
|
7356
|
+
},
|
|
7357
|
+
scrollbarY: {},
|
|
7358
|
+
},
|
|
7359
|
+
xAxis: {
|
|
7360
|
+
type: 'date',
|
|
7361
|
+
valueField: 'date',
|
|
7362
|
+
baseInterval: {
|
|
7363
|
+
timeUnit: 'day',
|
|
7364
|
+
count: 1,
|
|
7365
|
+
},
|
|
7366
|
+
gridHidden: true,
|
|
7367
|
+
startLocation: 1,
|
|
7368
|
+
endLocation: 0,
|
|
7369
|
+
renderer: {
|
|
7370
|
+
minGridDistance: 30,
|
|
7371
|
+
},
|
|
7372
|
+
},
|
|
7373
|
+
yAxis: {
|
|
7374
|
+
type: 'value',
|
|
7375
|
+
strictMinMax: true,
|
|
7376
|
+
},
|
|
7377
|
+
series: {
|
|
7378
|
+
valueXField: 'date',
|
|
7379
|
+
dataProcessor: {
|
|
7380
|
+
dateFields: ['date'],
|
|
7381
|
+
dateFormat: 'yyyy-MM-dd',
|
|
7382
|
+
},
|
|
7383
|
+
seriesTypes: [
|
|
7384
|
+
{
|
|
7385
|
+
type: 'stack-line',
|
|
7386
|
+
categoryGroupName: 'ondemand_cost',
|
|
7387
|
+
lineType: 'smoothedX',
|
|
7388
|
+
bullet: {
|
|
7389
|
+
type: 'circle',
|
|
7390
|
+
lineOnly: true,
|
|
7391
|
+
},
|
|
7392
|
+
},
|
|
7393
|
+
{
|
|
7394
|
+
type: 'stack',
|
|
7395
|
+
categoryGroupName: 'savings_cost',
|
|
7396
|
+
},
|
|
7397
|
+
],
|
|
7398
|
+
tooltip: {
|
|
7399
|
+
type: 'CG',
|
|
7400
|
+
stopActionEnabled: true,
|
|
7401
|
+
header: {
|
|
7402
|
+
name: '{valueX.formatDate("MM/dd")}',
|
|
7403
|
+
},
|
|
7404
|
+
body: {
|
|
7405
|
+
maxRowCount: 10,
|
|
7406
|
+
name: '{name}',
|
|
7407
|
+
value: [
|
|
7408
|
+
{
|
|
7409
|
+
categoryGroupName: 'ondemand_cost',
|
|
7410
|
+
value:
|
|
7411
|
+
'\${valueY.formatNumber("0,0")}({valueYPercent.formatNumber("0.0")}%)',
|
|
7412
|
+
},
|
|
7413
|
+
{
|
|
7414
|
+
categoryGroupName: 'savings_cost',
|
|
7415
|
+
value: '\${valueY.formatNumber("0,0")}',
|
|
7416
|
+
},
|
|
7417
|
+
],
|
|
7418
|
+
useMarker: true,
|
|
7419
|
+
},
|
|
7420
|
+
footer: {
|
|
7421
|
+
name: 'Total',
|
|
7422
|
+
value: [
|
|
7423
|
+
{
|
|
7424
|
+
categoryGroupName: 'ondemand_cost',
|
|
7425
|
+
value: '\${valueYSum.formatNumber("0,0")}(100.0%)',
|
|
7426
|
+
},
|
|
7427
|
+
{
|
|
7428
|
+
categoryGroupName: 'savings_cost',
|
|
7429
|
+
value: '\${valueYSum.formatNumber("0,0")}',
|
|
7430
|
+
},
|
|
7431
|
+
],
|
|
7432
|
+
},
|
|
7433
|
+
},
|
|
7434
|
+
},
|
|
7435
|
+
cursor: {
|
|
7436
|
+
visibleY: false,
|
|
7437
|
+
behavior: 'zoomXY',
|
|
7438
|
+
},
|
|
7439
|
+
legend: {},
|
|
7440
|
+
})
|
|
7441
|
+
const [chartData, setChartData] = useState([
|
|
7442
|
+
{
|
|
7443
|
+
date: '2022-12-01',
|
|
7444
|
+
rds_ondemand_cost: 2000,
|
|
7445
|
+
elasti_cache_ondemand_cost: 2000,
|
|
7446
|
+
red_shift_ondemand_cost: 2000,
|
|
7447
|
+
sage_maker_ondemand_cost: 2000,
|
|
7448
|
+
sp_compute_ondemand_cost: 2000,
|
|
7449
|
+
rds_savings_cost: 200,
|
|
7450
|
+
elasti_cache_savings_cost: 200,
|
|
7451
|
+
red_shift_savings_cost: 200,
|
|
7452
|
+
sage_maker_savings_cost: 200,
|
|
7453
|
+
sp_compute_savings_cost: 10,
|
|
7454
|
+
},
|
|
7455
|
+
{
|
|
7456
|
+
date: '2022-12-02',
|
|
7457
|
+
rds_ondemand_cost: 2200,
|
|
7458
|
+
elasti_cache_ondemand_cost: 2200,
|
|
7459
|
+
red_shift_ondemand_cost: 2200,
|
|
7460
|
+
sage_maker_ondemand_cost: 2200,
|
|
7461
|
+
sp_compute_ondemand_cost: 2000,
|
|
7462
|
+
rds_savings_cost: 400,
|
|
7463
|
+
elasti_cache_savings_cost: 400,
|
|
7464
|
+
red_shift_savings_cost: 400,
|
|
7465
|
+
sage_maker_savings_cost: 400,
|
|
7466
|
+
sp_compute_savings_cost: 400,
|
|
7467
|
+
},
|
|
7468
|
+
{
|
|
7469
|
+
date: '2022-12-03',
|
|
7470
|
+
rds_ondemand_cost: 2400,
|
|
7471
|
+
elasti_cache_ondemand_cost: 2400,
|
|
7472
|
+
red_shift_ondemand_cost: 2400,
|
|
7473
|
+
sage_maker_ondemand_cost: 2400,
|
|
7474
|
+
sp_compute_ondemand_cost: 2400,
|
|
7475
|
+
rds_savings_cost: 400,
|
|
7476
|
+
elasti_cache_savings_cost: 400,
|
|
7477
|
+
red_shift_savings_cost: 400,
|
|
7478
|
+
sage_maker_savings_cost: 400,
|
|
7479
|
+
sp_compute_savings_cost: 400,
|
|
7480
|
+
},
|
|
7481
|
+
{
|
|
7482
|
+
date: '2022-12-04',
|
|
7483
|
+
rds_ondemand_cost: 1600,
|
|
7484
|
+
elasti_cache_ondemand_cost: 1600,
|
|
7485
|
+
red_shift_ondemand_cost: 1600,
|
|
7486
|
+
sage_maker_ondemand_cost: 1600,
|
|
7487
|
+
sp_compute_ondemand_cost: 1600,
|
|
7488
|
+
rds_savings_cost: 800,
|
|
7489
|
+
elasti_cache_savings_cost: 800,
|
|
7490
|
+
red_shift_savings_cost: 800,
|
|
7491
|
+
sage_maker_savings_cost: 800,
|
|
7492
|
+
sp_compute_savings_cost: 800,
|
|
7493
|
+
},
|
|
7494
|
+
{
|
|
7495
|
+
date: '2022-12-05',
|
|
7496
|
+
rds_ondemand_cost: 1800,
|
|
7497
|
+
elasti_cache_ondemand_cost: 1800,
|
|
7498
|
+
red_shift_ondemand_cost: 1800,
|
|
7499
|
+
sage_maker_ondemand_cost: 1800,
|
|
7500
|
+
sp_compute_ondemand_cost: 1800,
|
|
7501
|
+
rds_savings_cost: 800,
|
|
7502
|
+
elasti_cache_savings_cost: 800,
|
|
7503
|
+
red_shift_savings_cost: 800,
|
|
7504
|
+
sage_maker_savings_cost: 800,
|
|
7505
|
+
sp_compute_savings_cost: 800,
|
|
7506
|
+
},
|
|
7507
|
+
{
|
|
7508
|
+
date: '2022-12-06',
|
|
7509
|
+
rds_ondemand_cost: 2000,
|
|
7510
|
+
elasti_cache_ondemand_cost: 2000,
|
|
7511
|
+
red_shift_ondemand_cost: 2000,
|
|
7512
|
+
sage_maker_ondemand_cost: 2000,
|
|
7513
|
+
sp_compute_ondemand_cost: 2000,
|
|
7514
|
+
rds_savings_cost: 600,
|
|
7515
|
+
elasti_cache_savings_cost: 600,
|
|
7516
|
+
red_shift_savings_cost: 600,
|
|
7517
|
+
sage_maker_savings_cost: 600,
|
|
7518
|
+
sp_compute_savings_cost: 600,
|
|
7519
|
+
}
|
|
7520
|
+
// ... 이후 날짜도 같은 형태 (줌/스크롤은 데이터가 많을 때 의미가 있으므로 실제로는 15일치 이상을 넣습니다)
|
|
7521
|
+
])
|
|
7522
|
+
const [chartCategory, setChartCategory] = useState([
|
|
7523
|
+
{
|
|
7524
|
+
name: 'ondemand_cost',
|
|
7525
|
+
categories: [
|
|
7526
|
+
'rds_ondemand_cost',
|
|
7527
|
+
'elasti_cache_ondemand_cost',
|
|
7528
|
+
'red_shift_ondemand_cost',
|
|
7529
|
+
'sage_maker_ondemand_cost',
|
|
7530
|
+
'sp_compute_ondemand_cost',
|
|
7531
|
+
// 'open_search_ondemand_cost',
|
|
7532
|
+
// 'compute_group_ondemand_cost'
|
|
7533
|
+
],
|
|
7534
|
+
},
|
|
7535
|
+
{
|
|
7536
|
+
name: 'savings_cost',
|
|
7537
|
+
categories: [
|
|
7538
|
+
'rds_savings_cost',
|
|
7539
|
+
'elasti_cache_savings_cost',
|
|
7540
|
+
'red_shift_savings_cost',
|
|
7541
|
+
'sage_maker_savings_cost',
|
|
7542
|
+
'sp_compute_savings_cost',
|
|
7543
|
+
// 'open_search_savings_cost',
|
|
7544
|
+
// 'compute_group_savings_cost'
|
|
7545
|
+
],
|
|
7546
|
+
},
|
|
7547
|
+
])
|
|
7548
|
+
`,
|
|
7549
|
+
code: `<OpsnowCommonXyMultiChart
|
|
7550
|
+
chartId={chartId}
|
|
7551
|
+
ref={chartRef}
|
|
7552
|
+
chartProps={chartProps}
|
|
7553
|
+
chartData={chartData}
|
|
7554
|
+
chartCategory={chartCategory}
|
|
7555
|
+
/>`
|
|
7556
|
+
}
|
|
6556
7557
|
];
|
|
6557
7558
|
// Heatmap Chart 컴포넌트 예제 데이터
|
|
6558
7559
|
export const HeatmapChartExamples = [
|