echarts官网卡?

全网echarts案例资源大总结和echarts的高效使用技巧(细节版) - 掘金

echarts图表集ECharts图表集,EChartsDemo集,echarts gallery,Make A Pie,分享你的可视化作品isqqw.comicon-default.png?t=N7T8https://www.isqqw.com/

    drawnLine() {
      let myChart = echarts.init(document.getElementById("grade"));
      // 绘制图表
      myChart.setOption({
        title: {
          left: "center",
        },
        tooltip: {
          trigger: "item",
        },
        series: [
          {
            name:'hahhaha',
            type: "pie",
            radius: ["40%", "70%"],
            labelLine: {
              normal: {
                lineStyle: {
                  color: "white",
                },
              },
            },
            color: ["#86c9f4", "#4da8ec", "#3a91d2", "#005fa6", "#315f97"],
            data: [
              { value: 335, name: "客服电话" },
              { value: 310, name: "奥迪官网" },
              { value: 234, name: "媒体曝光" },
              { value: 135, name: "质检总局" },
              { value: 105, name: "其他" },
            ],
            itemStyle: {
              normal: {
                label: {
                  show: true,
                  formatter: "{b} \n {c}",
                  textStyle: { color: "white", },
                },
              },
            },
          },
        ],
      });
    },

a代表series下的name值,b代表data中的name, c代表data中的value, d代表value所占百分比

### ECharts 指标使用方法 在构建数据可视化应用时,ECharts 提供了多种类型的图表和组件来满足不同的需求。对于指标这种特定的数据展示形式,在实际项目中通常会利用 ECharts 的 `gauge` 类型图表实现。 #### 创建基本的 Gauge 图表 要创建一个简单的 gauge 图表作为指标,可以按照如下方式进行配置: ```javascript // 初始化echarts实例 var myChart = echarts.init(document.getElementById('main')); option = { series: [ { type: 'gauge', // 设置图表类型为仪表盘(gauge) detail: {formatter:'{value}%'}, // 显示百分比数值 data: [{value: 70, name: '完成度'}], // 数据项设置 title : { offsetCenter: [0, '-40%'], // x, y,单位px }, axisLine: { // 坐标轴线 lineStyle: { // 属性lineStyle控制线条样式 width: 30, } }, splitLine: { // 分隔线 length: 15 // 属性length控制线长 }, axisTick: { // 坐标轴小标记 length: 8 // 属性length控制线长 }, axisLabel: { // 坐标轴文本标签 color:'#fff', distance: 20 // 文字距离刻度的距离,默认为5 }, pointer: { // 仪表盘指针 length: '90%', width: 8 } } ] }; myChart.setOption(option); ``` 此段代码展示了如何初始化并配置一个带有百分比显示的基础 gauge 图表[^1]。通过调整 option 中的各项参数,能够定制化地改变仪表盘的颜色、大小以及数据显示格式等特性以适应具体的应用场景。 为了使该指标更贴合业务逻辑或视觉设计的要求,还可以进一步自定义其外观属性,比如修改背景颜色、字体风格或是加入额外的文字说明等。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

每天吃饭的羊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值