diff --git a/src/components/Charts/keyboard.vue b/src/components/Charts/keyboard.vue index 59aca4dc..4c2a0bbd 100644 --- a/src/components/Charts/keyboard.vue +++ b/src/components/Charts/keyboard.vue @@ -45,21 +45,22 @@ export default { const xAxisData = [] const data = [] - for (let i = 0; i < 30; i++) { - xAxisData.push(i + '号') - data.push(Math.round(Math.random() * 2 + 3)) + const data2 = [] + for (let i = 0; i < 50; i++) { + xAxisData.push(i) + data.push((Math.sin(i / 5) * (i / 5 - 10) + i / 6) * 5) + data2.push((Math.sin(i / 5) * (i / 5 + 10) + i / 6) * 3) } - this.chart.setOption( { backgroundColor: '#08263a', - tooltip: { - trigger: 'axis' - }, - xAxis: { + xAxis: [{ show: false, data: xAxisData - }, + }, { + show: false, + data: xAxisData + }], visualMap: { show: false, min: 0, @@ -84,28 +85,64 @@ export default { color: '#08263f' } }, - axisTick: {} + axisTick: { + show: false + } }, series: [{ + name: 'back', type: 'bar', - data, - name: '撸文数', + data: data2, + z: 1, itemStyle: { normal: { + opacity: 0.4, barBorderRadius: 5, - shadowBlur: 10, + shadowBlur: 3, shadowColor: '#111' } - }, - animationEasing: 'elasticOut', - animationEasingUpdate: 'elasticOut', - animationDelay(idx) { - return idx * 20 - }, - animationDelayUpdate(idx) { - return idx * 20 } - }] + }, { + name: 'Simulate Shadow', + type: 'line', + data, + z: 2, + showSymbol: false, + animationDelay: 0, + animationEasing: 'linear', + animationDuration: 1200, + lineStyle: { + normal: { + color: 'transparent' + } + }, + areaStyle: { + normal: { + color: '#08263a', + shadowBlur: 50, + shadowColor: '#000' + } + } + }, { + name: 'front', + type: 'bar', + data, + xAxisIndex: 1, + z: 3, + itemStyle: { + normal: { + barBorderRadius: 5 + } + } + }], + animationEasing: 'elasticOut', + animationEasingUpdate: 'elasticOut', + animationDelay(idx) { + return idx * 20 + }, + animationDelayUpdate(idx) { + return idx * 20 + } }) } } diff --git a/src/components/Charts/keyboard2.vue b/src/components/Charts/keyboard2.vue deleted file mode 100644 index 4c2a0bbd..00000000 --- a/src/components/Charts/keyboard2.vue +++ /dev/null @@ -1,150 +0,0 @@ - - - diff --git a/src/lang/en.js b/src/lang/en.js index 7b1e6094..c6acf457 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -21,7 +21,6 @@ export default { charts: 'Charts', chartsIndex: 'Introduction', keyboardChart: 'Keyboard Chart', - keyboardChart2: 'Keyboard Chart2', lineChart: 'Line chart', mixChart: 'Mix Chart', example: 'Example', diff --git a/src/lang/zh.js b/src/lang/zh.js index 070d673f..35bbefe6 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -21,7 +21,6 @@ export default { charts: '图表', chartsIndex: '介绍', keyboardChart: '键盘图表', - keyboardChart2: '键盘图表2', lineChart: '折线图', mixChart: '混合图表', example: '综合实例', diff --git a/src/router/index.js b/src/router/index.js index 926eea46..bef8a4f0 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -87,8 +87,6 @@ export const asyncRouterMap = [ { path: '/components', component: Layout, - redirect: '/components/index', - name: 'components', meta: { title: 'components', icon: 'component' @@ -119,10 +117,9 @@ export const asyncRouterMap = [ }, children: [ { path: 'index', component: _import('charts/index'), name: 'chartsIndex', meta: { title: 'chartsIndex' }}, - { path: 'keyboard', component: _import('charts/keyboard'), name: 'keyboardChart', meta: { title: 'keyboardChart' }}, - { path: 'keyboard2', component: _import('charts/keyboard2'), name: 'keyboardChart2', meta: { title: 'keyboardChart2' }}, - { path: 'line', component: _import('charts/line'), name: 'lineChart', meta: { title: 'lineChart' }}, - { path: 'mixchart', component: _import('charts/mixChart'), name: 'mixChart', meta: { title: 'mixChart' }} + { path: 'keyboard', component: _import('charts/keyboard'), name: 'keyboardChart', meta: { title: 'keyboardChart', noCache: true }}, + { path: 'line', component: _import('charts/line'), name: 'lineChart', meta: { title: 'lineChart', noCache: true }}, + { path: 'mixchart', component: _import('charts/mixChart'), name: 'mixChart', meta: { title: 'mixChart', noCache: true }} ] }, diff --git a/src/views/charts/keyboard2.vue b/src/views/charts/keyboard2.vue deleted file mode 100644 index 9c797b6b..00000000 --- a/src/views/charts/keyboard2.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - -