ZhangXianQiang
2024-02-28 d1e7425d15ac6c6cf784ea1c84963221bd47413d
fix:完善图表
1个文件已修改
58 ■■■■ 已修改文件
src/views/daoAnOffice/right/analysis/index.vue 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/daoAnOffice/right/analysis/index.vue
@@ -28,14 +28,14 @@
]);
const testData = ref([
  { name: '奎光塔街道', state1: 972, state2: 2124, state3: 1500 },
  { name: '蒲阳街道', state1: 972, state2: 2124, state3: 1500 },
  { name: '奎光塔街道', state1: 1400, state2: 3533, state3: 2316 },
  { name: '蒲阳街道', state1: 1820, state2: 4281, state3: 3064 },
  { name: '聚源镇', state1: 972, state2: 2124, state3: 1500 },
  { name: '银杏街道', state1: 972, state2: 2124, state3: 1500 },
  { name: '银杏街道', state1: 1109, state2: 2876, state3: 1500 },
  { name: '石羊镇', state1: 972, state2: 2124, state3: 1500 },
  { name: '龙池镇', state1: 972, state2: 2124, state3: 1500 },
  { name: '天马镇', state1: 972, state2: 2124, state3: 1500 },
  { name: '玉堂街道', state1: 972, state2: 2124, state3: 1500 },
  { name: '天马镇', state1: 972, state2: 4000, state3: 1500 },
  { name: '玉堂街道', state1: 972, state2: 2878, state3: 1500 },
  { name: '灌口街道', state1: 972, state2: 2124, state3: 1500 },
]);
@@ -43,9 +43,31 @@
const echartsConfig = {
  legend: {
    right: '0',
    icon: 'circle',
    textStyle: {
      color: 'rgba(77, 118, 176, 1)'
    },
    data: [
      {
        name: '醉驾',
        itemStyle: {
          color: 'rgba(0, 168, 217, 1)'
        }
      },
      {
        name: '酒驾',
        itemStyle: {
          color: 'rgba(207, 178, 73, 1)'
        }
      },
      {
        name: '其他',
        itemStyle: {
          color: 'rgba(43, 176, 109, 1)'
        }
      },
    ]
  },
  tooltip: {},
  grid: {
@@ -59,7 +81,7 @@
    dimensions: ['name', 'state1', 'state2', 'state3'],
    source: testData.value
  },
  xAxis: { type: 'category' },
  xAxis: { type: 'category', axisTick: false },
  yAxis: {},
  // Declare several bar series, each will be mapped
  // to a column of dataset.source by default.
@@ -67,6 +89,14 @@
    {
      type: 'bar',
      name: '醉驾',
      barWidth: 13,
      barGap: '50%',
      label: {
        show: true, // 显示标签
        position: 'top', // 标签位置
        color: 'rgba(0, 168, 217, 1)', // 标签颜色
        fontSize: 10,
      },
      itemStyle: {
        // 设置渐变色
        color: new echarts.graphic.LinearGradient(
@@ -81,6 +111,14 @@
    {
      type: 'bar',
      name: '酒驾',
      barWidth: 13,
      barGap: '50%',
      label: {
        show: true, // 显示标签
        position: 'top', // 标签位置
        color: 'rgba(207, 178, 73, 1)', // 标签颜色
        fontSize: 10,
      },
      itemStyle: {
        // 设置渐变色
        color: new echarts.graphic.LinearGradient(
@@ -95,6 +133,14 @@
    {
      type: 'bar',
      name: '其他',
      barWidth: 13,
      barGap: '50%',
      label: {
        show: true, // 显示标签
        position: 'top', // 标签位置
        color: 'rgba(43, 176, 109, 1)', // 标签颜色
        fontSize: 10,
      },
      itemStyle: {
        // 设置渐变色
        color: new echarts.graphic.LinearGradient(