-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
##################### 1. Plot Band Sample Code 추가 2. 기존 Sample Code 원복
- Loading branch information
Showing
8 changed files
with
416 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<template> | ||
<ev-chart | ||
:data="chartData" | ||
:options="chartOptions" | ||
/> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
setup() { | ||
const chartData = { | ||
series: { | ||
series1: { name: 'series#1', color: '#FEC64F', showValue: { use: true } }, | ||
series2: { name: 'series#2', color: '#48D1CC', showValue: { use: true } }, | ||
}, | ||
labels: [ | ||
'value1', | ||
'value2', | ||
'value3', | ||
'value4', | ||
'value5', | ||
], | ||
data: { | ||
series1: [100, 150, 51, 150, { value: 350, color: '#FF0000' }], | ||
series2: [150, 100, 151, 50, 250], | ||
}, | ||
}; | ||
const chartOptions = { | ||
type: 'bar', | ||
thickness: 0.8, | ||
width: '100%', | ||
padding: { | ||
right: 40, | ||
}, | ||
title: { | ||
text: 'Chart Title', | ||
show: true, | ||
}, | ||
legend: { | ||
show: true, | ||
position: 'right', | ||
}, | ||
axesX: [{ | ||
type: 'step', | ||
showGrid: false, | ||
labelStyle: { | ||
fitWidth: true, | ||
fitDir: 'left', | ||
}, | ||
plotBands: [{ | ||
color: 'rgba(250, 222, 76, 0.8)', | ||
from: 2.5, | ||
to: 3.5, | ||
label: { | ||
text: 'X Plot Band ZONE', | ||
fontColor: '#FFA500', | ||
}, | ||
}], | ||
}], | ||
axesY: [{ | ||
type: 'linear', | ||
startToZero: true, | ||
autoScaleRatio: 0.1, | ||
showGrid: false, | ||
plotLines: [{ | ||
value: 180, | ||
color: '#FFA500', | ||
label: { | ||
text: 'Warning', | ||
fontColor: '#FFA500', | ||
}, | ||
}, { | ||
value: 300, | ||
label: { | ||
lineWidth: 1, | ||
lineColor: '#000000', | ||
fillColor: '#FF0000', | ||
fontColor: '#FFFFFF', | ||
text: 'Critical', | ||
}, | ||
}], | ||
plotBands: [{ | ||
color: 'rgba(104, 173, 244, 0.3)', | ||
from: 0, // 생략 가능 | ||
to: 120, | ||
label: { | ||
text: 'Y Plot Band', | ||
fontColor: '#68ADF4', | ||
}, | ||
}], | ||
}], | ||
}; | ||
return { | ||
chartData, | ||
chartOptions, | ||
}; | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<template> | ||
<ev-chart | ||
:data="chartData" | ||
:options="chartOptions" | ||
/> | ||
</template> | ||
|
||
<script> | ||
import dayjs from 'dayjs'; | ||
export default { | ||
setup() { | ||
const time = dayjs().format('YYYY-MM-DD HH:mm:ss'); | ||
const chartData = { | ||
series: { | ||
series1: { name: 'series#1' }, | ||
series2: { name: 'series#2' }, | ||
}, | ||
labels: [ | ||
dayjs(time), | ||
dayjs(time).add(1, 'day'), | ||
dayjs(time).add(2, 'day'), | ||
dayjs(time).add(3, 'day'), | ||
dayjs(time).add(4, 'day'), | ||
dayjs(time).add(5, 'day'), | ||
dayjs(time).add(6, 'day'), | ||
], | ||
data: { | ||
series1: [100, 25, 36, 47, 0, 50, 80], | ||
series2: [80, 36, 25, 47, 15, 100, 0], | ||
}, | ||
}; | ||
const chartOptions = { | ||
type: 'line', | ||
width: '100%', | ||
padding: { | ||
right: 50, | ||
}, | ||
title: { | ||
text: 'Chart Title', | ||
show: true, | ||
}, | ||
legend: { | ||
show: true, | ||
position: 'right', | ||
}, | ||
axesX: [{ | ||
type: 'time', | ||
showGrid: false, | ||
timeFormat: 'MM/DD', | ||
interval: 'day', | ||
plotLines: [{ | ||
color: '#FF0000', | ||
value: chartData.labels[5], | ||
segments: [6, 2], | ||
label: { | ||
text: 'X Plot Line', | ||
textAlign: 'right', | ||
}, | ||
}], | ||
plotBands: [{ | ||
color: 'rgba(250, 222, 76, 0.8)', | ||
from: chartData.labels[2], | ||
to: chartData.labels[3], | ||
label: { | ||
text: 'X Plot Band ZONE', | ||
fontColor: '#FFA500', | ||
}, | ||
}], | ||
}], | ||
axesY: [{ | ||
type: 'linear', | ||
showGrid: true, | ||
startToZero: true, | ||
autoScaleRatio: 0.1, | ||
plotLines: [{ | ||
color: '#FF0000', | ||
value: 50, | ||
segments: [6, 2], | ||
label: { | ||
text: 'Y Plot Line', | ||
}, | ||
}], | ||
plotBands: [{ | ||
color: 'rgba(250, 222, 76, 0.8)', | ||
from: 20, | ||
to: 40, | ||
label: { | ||
text: 'Y Plot Band', | ||
fontColor: '#FFA500', | ||
}, | ||
}], | ||
}], | ||
}; | ||
return { | ||
chartData, | ||
chartOptions, | ||
}; | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss"> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.