AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-26211713

Jlv's questions

Martin Hope
Jlv
Asked: 2024-11-25 00:19:50 +0800 CST

深入探究后在顶层显示后退按钮

  • 6

我正在学习如何使用 eCharts 并尝试不同的类型。我剪切并粘贴了两种 eChart 条形类型,一种带有向下钻取 (id = main2),一种带有负值的水平 (id = main1);它们排列在单个表格行中。

两者都能正确呈现,向下钻取功能也运行良好;后退按钮按预期工作并显示正确的初始条形图;只不过返回后它在图表的顶层仍然可见。刷新页面会将其删除。

<head>
    <meta charset='utf-8' />


    
  </head>

<body>
  <table class="container-drilldown" >
    <thead>
        
    </thead>
    <tbody>
        <tr>  
          <td class='drilldown' class ='center' id='main2' style='width: 30vw; height:45vh' >
            <script type='text/javascript'>
    
              var chartDom = document.getElementById('main2');
              var myChart = echarts.init(chartDom);
              var option = {
                xAxis: {
                  data: ['Animals', 'Fruits', 'Cars']
                },
                yAxis: {},
                dataGroupId: '',
                animationDurationUpdate: 500,
                series: {
                  type: 'bar',
                  id: 'sales',
                  data: [
                    {
                      value: 5,
                      groupId: 'animals'
                    },
                    {
                      value: 2,
                      groupId: 'fruits'
                    },
                    {
                      value: 4,
                      groupId: 'cars'
                    }
                  ],
                  universalTransition: {
                    enabled: true,
                    divideShape: 'clone'
                  }
                }
              };
              const drilldownData = [
                {
                  dataGroupId: 'animals',
                  data: [
                    ['Cats', 4],
                    ['Dogs', 2],
                    ['Cows', 1],
                    ['Sheep', 2],
                    ['Pigs', 1]
                  ]
                },
                {
                  dataGroupId: 'fruits',
                  data: [
                    ['Apples', 4],
                    ['Oranges', 2]
                  ]
                },
                {
                  dataGroupId: 'cars',
                  data: [
                    ['Toyota', 4],
                    ['Opel', 2],
                    ['Volkswagen', 2]
                  ]
                }
              ];
              myChart.on('click', function (event) {
                if (event.data) {
                  var subData = drilldownData.find(function (data) {
                    return data.dataGroupId === event.data.groupId;
                  });
                  if (!subData) {
                    return;
                  }
                  myChart.setOption({
                    xAxis: {
                      data: subData.data.map(function (item) {
                        return item[0];
                      })
                    },
                    series: {
                      type: 'bar',
                      id: 'sales',
                      dataGroupId: subData.dataGroupId,
                      data: subData.data.map(function (item) {
                        return item[1];
                      }),
                      universalTransition: {
                        enabled: true,
                        divideShape: 'clone'
                      }
                    },
                    graphic: [
                      {
                        type: 'text',
                        left: 50,
                        top: 20,
                        style: {
                          text: 'Back',
                          fontSize: 18
                        },
                        onclick: function () {
                          myChart.setOption(option);
                        }
                      }
                    ]
                  });
                }
              });
              
              option && myChart.setOption(option);
              
            
          </script>
        </td>
         

        <td class='drilldown' class ='center' id='main1' style='width: 30vw; height:45vh' >
          <script type='text/javascript'>
            var chartDom1 = document.getElementById('main1');
            var myChart1 = echarts.init(chartDom1);

            var option1 = {
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'shadow'
                }
              },
              legend: {
                data: ['Profit', 'Expenses', 'Income']
              },
              grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
              },
              xAxis: [
                {
                  type: 'value'
                }
              ],
              yAxis: [
                {
                  type: 'category',
                  axisTick: {
                    show: false
                  },
                  data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
                }
              ],
              series: [
                {
                  name: 'Profit',
                  type: 'bar',
                  label: {
                    show: true,
                    position: 'inside'
                  },
                  emphasis: {
                    focus: 'series'
                  },
                  data: [200, 170, 240, 244, 200, 220, 210]
                },
                {
                  name: 'Income',
                  type: 'bar',
                  stack: 'Total',
                  label: {
                    show: true
                  },
                  emphasis: {
                    focus: 'series'
                  },
                  data: [320, 302, 341, 374, 390, 450, 420]
                },
                {
                  name: 'Expenses',
                  type: 'bar',
                  stack: 'Total',
                  label: {
                    show: true,
                    position: 'left'
                  },
                  emphasis: {
                    focus: 'series'
                  },
                  data: [-120, -132, -101, -134, -190, -230, -210]
                }
              ]
            };

            option && myChart1.setOption(option1);
          </script>
      </td>

  </tr>
echarts
  • 1 个回答
  • 23 Views
Martin Hope
Jlv
Asked: 2024-11-13 00:21:01 +0800 CST

在 Apache eChart 中设置图表周围的边框

  • 5

有没有办法在 Apache eChart 中创建边框?我查看了文档,尝试了各种组合,但似乎无法在图表周围添加边框。

我将它们放在表格中并可以通过这种方式添加边框,但如果能够将它们添加到图表而不是表格中就更好了。

echarts
  • 1 个回答
  • 16 Views
Martin Hope
Jlv
Asked: 2024-09-27 07:25:06 +0800 CST

个别路径的 CSS 样式不起作用

  • 5

我有一个视觉效果,其中有 11 个热点,分布在 png 图形周围。我为每个热点创建了单独的路径,并希望创建一个链接以及一个悬停,该悬停会改变颜色以显示所选区域。链接和悬停适用于列表中的第一个图形,但不适用于以下任何图形。CSS 为:

 #path_cm:hover, #path_rm:hover, #path_is:hover, #path_bc:hover, #path_hr:hover, #path_ict:hover, #path_sc:hover, #path_fa:hover, #path_env:hover, #path_hs:hover, #path_em:hover  {
    opacity: .5
  }

HTML 是(删除了许多行 png 图形,第二个 python url 变量是一个占位符,用于查看是否需要 url 来激活悬停并将其替换为真实的 url):


 <div class='containervert' style='top: 5%;'>
        <?xml version="1.0" encoding="UTF-8"?>
        <!-- Generated by Pixelmator Pro 3.6.9 -->
        <svg width="720" height="688" viewBox="0 0 720 688" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">


(png data)

            <a href='{% url 'introduction' %}'>
            <path id="path_cm" fill="#027aff" stroke="none" opacity="0" d="M 707.76001 330.686188 C 707.76001 311.409363 692.125793 295.78241 672.840027 295.78241 C 653.554199 295.78241 637.919983 311.409363 637.919983 330.686188 C 637.919983 349.963013 653.554199 365.589966 672.840027 365.589966 C 692.125793 365.589966 707.76001 349.963013 707.76001 330.686188 Z"/>
            <a>
            <a href='{% url 'introduction' %}'>
            <path id="path_rm" fill="#027aff" stroke="none" opacity="0" d="M 676.919983 195.78241 C 676.919983 176.452454 661.249939 160.78241 641.920044 160.78241 C 622.590027 160.78241 606.919983 176.452454 606.919983 195.78241 C 606.919983 215.112366 622.590027 230.78241 641.920044 230.78241 C 661.249939 230.78241 676.919983 215.112366 676.919983 195.78241 Z"/>
            <a>
            <path id="#path_is" fill="#027aff" stroke="none" opacity="0" d="M 532.919983 52.78241 C 532.919983 33.452454 517.249939 17.78241 497.920013 17.78241 C 478.589996 17.78241 462.919983 33.452454 462.919983 52.78241 C 462.919983 72.112366 478.589996 87.78241 497.920013 87.78241 C 517.249939 87.78241 532.919983 72.112366 532.919983 52.78241 Z"/>
            <path id="#path_bc" fill="#027aff" stroke="none" opacity="0" d="M 707.919983 330.78241 C 707.919983 311.452454 692.249939 295.78241 672.920044 295.78241 C 653.590027 295.78241 637.919983 311.452454 637.919983 330.78241 C 637.919983 350.112366 653.590027 365.78241 672.920044 365.78241 C 692.249939 365.78241 707.919983 350.112366 707.919983 330.78241 Z"/>
            <path id="#path_hr" fill="#027aff" stroke="none" opacity="0" d="M 82.919983 332.78241 C 82.919983 313.452454 67.249954 297.78241 47.920013 297.78241 C 28.59001 297.78241 12.919983 313.452454 12.919983 332.78241 C 12.919983 352.112366 28.59001 367.78241 47.920013 367.78241 C 67.249954 367.78241 82.919983 352.112366 82.919983 332.78241 Z"/>
            <path id="#path_ict" fill="#027aff" stroke="none" opacity="0" d="M 676.919983 467.78241 C 676.919983 448.452454 661.249939 432.78241 641.920044 432.78241 C 622.590027 432.78241 606.919983 448.452454 606.919983 467.78241 C 606.919983 487.112366 622.590027 502.78241 641.920044 502.78241 C 661.249939 502.78241 676.919983 487.112366 676.919983 467.78241 Z"/>
            <path id="#path_sc" fill="#027aff" stroke="none" opacity="0" d="M 195.919983 570.78241 C 195.919983 551.452454 180.249954 535.78241 160.920013 535.78241 C 141.590012 535.78241 125.919983 551.452454 125.919983 570.78241 C 125.919983 590.112366 141.590012 605.78241 160.920013 605.78241 C 180.249954 605.78241 195.919983 590.112366 195.919983 570.78241 Z"/>
            <path id="#path_fa" fill="#027aff" stroke="none" opacity="0" d="M 311.919983 627.78241 C 311.919983 608.452454 296.249969 592.78241 276.920013 592.78241 C 257.589996 592.78241 241.919983 608.452454 241.919983 627.78241 C 241.919983 647.112366 257.589996 662.78241 276.920013 662.78241 C 296.249969 662.78241 311.919983 647.112366 311.919983 627.78241 Z"/>
            <path id="#path_env" fill="#027aff" stroke="none" opacity="0" d="M 474.919983 635.78241 C 474.919983 616.452454 459.249969 600.78241 439.920013 600.78241 C 420.589996 600.78241 404.919983 616.452454 404.919983 635.78241 C 404.919983 655.112366 420.589996 670.78241 439.920013 670.78241 C 459.249969 670.78241 474.919983 655.112366 474.919983 635.78241 Z"/>
            <path id="#path_hs" fill="#027aff" stroke="none" opacity="0" d="M 593.919983 574.78241 C 593.919983 555.452454 578.249939 539.78241 558.920044 539.78241 C 539.590027 539.78241 523.919983 555.452454 523.919983 574.78241 C 523.919983 594.112366 539.590027 609.78241 558.920044 609.78241 C 578.249939 609.78241 593.919983 594.112366 593.919983 574.78241 Z"/>
            <path id="#path_em" fill="#027aff" stroke="none" opacity="0" d="M 109.919983 467.78241 C 109.919983 448.452454 94.249954 432.78241 74.920013 432.78241 C 55.590012 432.78241 39.919983 448.452454 39.919983 467.78241 C 39.919983 487.112366 55.590012 502.78241 74.920013 502.78241 C 94.249954 502.78241 109.919983 487.112366 109.919983 467.78241 Z"/>
        </svg>
    
    
</div>
</body>
</html>

我根据名称为每个图形创建了 CSS 属性,并期望每个图形都呈现一个半透明的圆圈;但在列表中的第一个图形中,path_cm 的行为符合预期。

python
  • 1 个回答
  • 36 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    重新格式化数字,在固定位置插入分隔符

    • 6 个回答
  • Marko Smith

    为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会?

    • 2 个回答
  • Marko Smith

    VScode 自动卸载扩展的问题(Material 主题)

    • 2 个回答
  • Marko Smith

    Vue 3:创建时出错“预期标识符但发现‘导入’”[重复]

    • 1 个回答
  • Marko Smith

    具有指定基础类型但没有枚举器的“枚举类”的用途是什么?

    • 1 个回答
  • Marko Smith

    如何修复未手动导入的模块的 MODULE_NOT_FOUND 错误?

    • 6 个回答
  • Marko Smith

    `(表达式,左值) = 右值` 在 C 或 C++ 中是有效的赋值吗?为什么有些编译器会接受/拒绝它?

    • 3 个回答
  • Marko Smith

    在 C++ 中,一个不执行任何操作的空程序需要 204KB 的堆,但在 C 中则不需要

    • 1 个回答
  • Marko Smith

    PowerBI 目前与 BigQuery 不兼容:Simba 驱动程序与 Windows 更新有关

    • 2 个回答
  • Marko Smith

    AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String”

    • 1 个回答
  • Martin Hope
    Fantastic Mr Fox msvc std::vector 实现中仅不接受可复制类型 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant 使用 chrono 查找下一个工作日 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor 构造函数的成员初始化程序可以包含另一个成员的初始化吗? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský 为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul C++20 是否进行了更改,允许从已知绑定数组“type(&)[N]”转换为未知绑定数组“type(&)[]”? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann 为什么 {2,3,10} 和 {x,3,10} (x=2) 的顺序不同? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller 在 5.2 版中,bash 条件语句中的 [[ .. ]] 中的分号现在是可选的吗? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench 为什么双破折号 (--) 会导致此 MariaDB 子句评估为 true? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng 为什么 `dict(id=1, **{'id': 2})` 有时会引发 `KeyError: 'id'` 而不是 TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String” 2024-03-20 03:12:31 +0800 CST

热门标签

python javascript c++ c# java typescript sql reactjs html

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve