From 69ff5446e4fc09b53372d45647514d2ac46254e1 Mon Sep 17 00:00:00 2001 From: hyx Date: Mon, 13 Dec 2021 10:18:27 +0800 Subject: [PATCH] =?UTF-8?q?CN-229=20Cyptocurrency--=E6=8C=96=E7=9F=BF?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=BB=9F=E8=AE=A1=E6=96=B0=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=BC=80=E5=8F=91=20CN-230=20Cyptocurrency--=E7=9F=BF=E6=9C=BA?= =?UTF-8?q?=E6=89=80=E5=B1=9E=E5=8D=95=E4=BD=8D=E6=96=B0=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/charts/chart-options.js | 36 +- src/components/rightBox/settings/ChartBox.vue | 538 +++++++++--------- src/views/charts/Chart.vue | 194 +++---- 3 files changed, 384 insertions(+), 384 deletions(-) diff --git a/src/components/charts/chart-options.js b/src/components/charts/chart-options.js index 4a20b21d..d0183a2e 100644 --- a/src/components/charts/chart-options.js +++ b/src/components/charts/chart-options.js @@ -11,7 +11,7 @@ export const chartColor = ['#5370C6', '#90CC74', '#FAC858', '#EE6666', '#73BFDE', '#3BA172', '#FC8452', '#9960B4', '#E97CCC', '#FEA69E', '#0F8AB2', '#57CBAC', '#5888BC', '#63B6AC', '#EDC6B2', '#D5746B'] -export const chartBarColor = [ '#0F8AB2', '#57CBAC'] +export const chartBarColor = ['#0F8AB2', '#57CBAC'] export function getChartColor (index) { return chartColor[index % chartColor.length] } @@ -491,24 +491,24 @@ const categoryBar = { left: 10, right: 25, bottom: 20, - containLabel:true + containLabel: true }, yAxis: { type: 'value', axisTick: { show: false }, axisLine: { show: false } }, - color:chartColor, + color: chartColor, series: [{ barWidth: 15, data: [], type: 'bar', - label: { show: false}, + label: { show: false }, barCategoryGap: '10%', itemStyle: { - color: function(params) { - return getCharBartColor([params.dataIndex]) - }, + color: function (params) { + return getCharBartColor([params.dataIndex]) + } } }] } @@ -532,10 +532,10 @@ const timeBar = { axisLine: { show: false }, axisLabel: { interval: 0, - //rotate: -40, //设置日期显示样式(倾斜度) - formatter: function (value) {//在这里写你需要的时间格式 - var t_date = new Date(value); - return [t_date.getMonth() + 1, t_date.getDate()].join('/')+ " " + [t_date.getHours(), t_date.getMinutes()].join(':'); + // rotate: -40, //设置日期显示样式(倾斜度) + formatter: function (value) { // 在这里写你需要的时间格式 + const t_date = new Date(value) + return [t_date.getMonth() + 1, t_date.getDate()].join('/') + ' ' + [t_date.getHours(), t_date.getMinutes()].join(':') } } }, @@ -544,7 +544,7 @@ const timeBar = { left: 25, right: 25, bottom: 20, - containLabel:true + containLabel: true }, yAxis: { type: 'value', @@ -557,17 +557,17 @@ const timeBar = { }, minInterval: 1 }, - color:chartColor, + color: chartColor, series: [{ barWidth: 15, data: [], type: 'bar', - label: { show: false}, + label: { show: false }, barCategoryGap: '10%', itemStyle: { - color: function(params) { + color: function (params) { return getCharBartColor([params.dataIndex]) - }, + } } }] } @@ -798,7 +798,7 @@ export function categoryHorizontalFormatter (params) { let str = '
' params.forEach((item, i) => { str += '
' - str += item.data[1]+': ' + item.data[0] + str += item.data[1] + ': ' + item.data[0] str += '
' }) str += '
' @@ -808,7 +808,7 @@ export function categoryVerticalFormatter (params) { let str = '
' params.forEach((item, i) => { str += '
' - str += item.data[0]+': ' + item.data[1] + str += item.data[0] + ': ' + item.data[1] str += '
' }) str += '
' diff --git a/src/components/rightBox/settings/ChartBox.vue b/src/components/rightBox/settings/ChartBox.vue index 710c9908..db19da0e 100644 --- a/src/components/rightBox/settings/ChartBox.vue +++ b/src/components/rightBox/settings/ChartBox.vue @@ -131,282 +131,282 @@