12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- import * as echarts from "echarts";
- import "echarts-wordcloud";
- // 时间分布
- export const getRiskTimeEchartsOption = () => {
- return {
- tooltip: { trigger: 'axis' },
- grid: { left: '8%', right: '2%', top: '10%', bottom: '18%' }, // 调整四周距离
- xAxis: {
- type: 'category',
- data: ['12/04', '12/05', '12/06', '12/07', '12/08', '12/09', '12/10'],
- axisLine: {
- lineStyle: {
- color: '#3FA7B6',
- width: 2, // 线宽
- dashOffset: 0, // 可能影响虚线样式,通常设为 0
- }
- }, // X 轴颜色
- axisTick: { show: false }, // 隐藏刻度线
- axisLabel: { color: '#9da8b8' } // X 轴文字颜色
- },
- yAxis: {
- type: 'value',
- axisLine: { lineStyle: { color: '#4A90E2' } }, // Y 轴颜色
- axisLabel: { color: '#7d8ba0' }, // Y 轴刻度值颜色
- splitLine: {
- lineStyle: {
- type: 'dashed', // 虚线
- color: '#3FA7B6',
- width: 1.5, // 线宽
- dashOffset: 0, // 可能影响虚线样式,通常设为 0
- }
- } // Y 轴背景横线虚线
- },
- series: [
- {
- type: 'bar',
- data: [3, 6, 2, 9, 5, 8, 10],
- barWidth: 17,
- itemStyle: {
- color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
- { offset: 0, color: 'rgba(63, 174, 253, 0)' },
- { offset: 1, color: '#3FAEFD' }
- ])
- },
- barBackgroundStyle: { color: 'rgba(74, 144, 226, 0.2)' } // 背景透明色
- }
- ]
- };
- };
- export const getRiskAreaEchartsOption = () => {
- return {
- tooltip: { trigger: 'axis' },
- grid: { left: '10%', right: '5%', top: '10%', bottom: '18%' }, // 调整四周距离
- xAxis: {
- type: 'category',
- data: ['长宁区', '闵行区'],
- axisLine: {
- lineStyle: {
- color: '#3FA7B6',
- width: 2, // 线宽
- dashOffset: 0, // 可能影响虚线样式,通常设为 0
- }
- }, // X 轴颜色
- axisLabel: { color: '#9da8b8' } // X 轴文字颜色
- },
- yAxis: {
- type: 'value',
- axisLine: { lineStyle: { color: '#ccc' } }, // Y 轴颜色
- splitLine: {
- lineStyle: {
- type: 'dashed', // 虚线
- color: '#3FA7B6',
- width: 1.5, // 线宽
- dashOffset: 0, // 可能影响虚线样式,通常设为 0
- } } // Y 轴背景横线虚线
- },
- series: [
- {
- type: 'bar',
- data: [5, 9],
- barWidth: 17,
- itemStyle: {
- color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
- { offset: 0, color: 'rgba(251,165,65,0)' },
- { offset: 1, color: '#FBA541' }
- ])
- }
- }
- ]
- };
- };
|