国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

echarts3d柱狀圖

這篇具有很好參考價(jià)值的文章主要介紹了echarts3d柱狀圖。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

//畫立方體三個(gè)面
const CubeLeft = echarts.graphic.extendShape({
  shape: {
    x: 0,
    y: 0,
    width: 9.5, //柱狀圖寬
    zWidth: 4, //陰影折角寬
    zHeight: 3, //陰影折角高
  },
  buildPath: function (ctx, shape) {
    const api = shape.api;
    const xAxisPoint = api.coord([shape.xValue, 0]);
    const p0 = [shape.x - shape.width / 2, shape.y - shape.zHeight];
    const p1 = [shape.x - shape.width / 2, shape.y - shape.zHeight];
    const p2 = [xAxisPoint[0] - shape.width / 2, xAxisPoint[1]];
    const p3 = [xAxisPoint[0] + shape.width / 2, xAxisPoint[1]];
    const p4 = [shape.x + shape.width / 2, shape.y];

    ctx.moveTo(p0[0], p0[1]);
    // ctx.lineTo(p1[0], p1[1]);
    ctx.lineTo(p2[0], p2[1]);
    ctx.lineTo(p3[0], p3[1]);
    ctx.lineTo(p4[0], p4[1]);

    ctx.closePath();
  },
});
const CubeRight = echarts.graphic.extendShape({
  shape: {
    x: 0,
    y: 0,
    width: 9,
    zWidth: 9.5,
    zHeight: 5.5,
  },
  buildPath: function (ctx, shape) {
    const api = shape.api;
    const xAxisPoint = api.coord([shape.xValue, 0]);
    const p1 = [shape.x - shape.width / 2, shape.y - shape.zHeight / 2];
    const p3 = [xAxisPoint[0] + shape.width / 2, xAxisPoint[1]];
    const p4 = [shape.x + shape.width / 2, shape.y];
    const p5 = [xAxisPoint[0] + shape.width / 2 + shape.zWidth, xAxisPoint[1]];
    const p6 = [
      shape.x + shape.width / 2 + shape.zWidth,
      shape.y - shape.zHeight / 2,
    ];
    const p7 = [
      shape.x - shape.width / 2 + shape.zWidth,
      shape.y - shape.zHeight,
    ];
    ctx.moveTo(p4[0], p4[1]);
    ctx.lineTo(p3[0], p3[1]);
    ctx.lineTo(p5[0], p5[1]);
    ctx.lineTo(p6[0], p6[1]);
    ctx.lineTo(p4[0], p4[1]);

    // ctx.moveTo(p4[0], p4[1]);
    // ctx.lineTo(p6[0], p6[1]);
    // ctx.lineTo(p7[0], p7[1]);
    // ctx.lineTo(p1[0], p1[1]);
    // ctx.lineTo(p4[0], p4[1]);
    ctx.closePath();
  },
});
const CubeTop = echarts.graphic.extendShape({
  shape: {
    x: 0,
    y: 0,
    width: 9,
    zWidth: 9.5,
    zHeight: 6,
  },
  buildPath: function (ctx, shape) {
    const api = shape.api;
    const xAxisPoint = api.coord([shape.xValue, 0]);
    const p1 = [shape.x - shape.width / 2, shape.y - shape.zHeight / 2];
    const p3 = [xAxisPoint[0] + shape.width / 2, xAxisPoint[1]];
    const p4 = [shape.x + shape.width / 2, shape.y];
    const p5 = [xAxisPoint[0] + shape.width / 2 + shape.zWidth, xAxisPoint[1]];
    const p6 = [
      shape.x + shape.width / 2 + shape.zWidth,
      shape.y - shape.zHeight / 2,
    ];
    const p7 = [
      shape.x - shape.width / 2 + shape.zWidth,
      shape.y - shape.zHeight,
    ];
    // ctx.moveTo(p4[0], p4[1]);
    // ctx.lineTo(p3[0], p3[1]);
    // ctx.lineTo(p5[0], p5[1]);
    // ctx.lineTo(p6[0], p6[1]);
    // ctx.lineTo(p4[0], p4[1]);

    ctx.moveTo(p4[0], p4[1]);
    ctx.lineTo(p6[0], p6[1]);
    ctx.lineTo(p7[0], p7[1]);
    ctx.lineTo(p1[0], p1[1]);

    ctx.closePath();
  },
});
echarts.graphic.registerShape("CubeLeft", CubeLeft);
echarts.graphic.registerShape("CubeRight", CubeRight);
echarts.graphic.registerShape("CubeTop", CubeTop);
//定義顏色值
const colors = [
  [
    { offset: 0, color: "rgb(254, 223, 34)" },
    { offset: 0.5, color: "rgba(254, 223, 34,0.2)" },
    { offset: 1, color: "rgba(0, 0, 0,0.3)" },
  ],
  [
    { offset: 0, color: "rgba(23, 252, 238)" },
    { offset: 0.5, color: "rgba(23, 252, 238,0.2)" },
    { offset: 1, color: "rgba(0, 0, 0,0.3)" },
  ],
];
const leftColors = [
  [
    { offset: 0, color: "rgb(254, 223, 34,0.7)" },
    { offset: 0.5, color: "rgba(254, 223, 34,0.9)" },
    { offset: 1, color: "rgba(0, 0, 0,0.3)" },
  ],
  [
    { offset: 0, color: "rgba(23, 252, 238,0.7)" },
    { offset: 0.5, color: "rgba(23, 252, 238,0.9)" },
    { offset: 1, color: "rgba(0, 0, 0,0.3)" },
  ],
];
const topColors = [
  [
    {
      offset: 0,
      color: "rgba(204, 186, 49,0.5)",
    },
    {
      offset: 1,
      color: "rgba(204, 186, 49,0.8)",
    },
  ],
  [
    {
      offset: 0,
      color: "rgba(17, 159, 174,0.5)",
    },
    {
      offset: 1,
      color: "rgba(17, 159, 174,0.8)",
    },
  ],
];
function getSeriesData() {
  const data = [];
  seriesData.forEach((item, index) => {
    data.push({
      type: "custom",
      name: item.label,
      renderItem: function (params, api) {
        return getRenderItem(params, api);
      },
      // label:{
      //  show:true,
      // },
      data: item.data,
      itemStyle: {
        color: () => {
          return new echarts.graphic.LinearGradient(0, 0, 0, 1, colors[index]);
        },
      },
    });
  });
  data.push(
    {
      type: "bar",
      itemStyle: {
        color: "transparent",
      },
      label: {
        normal: {
          show: true,
          position: "top",
          fontSize: 12,
          color: "rgba(255, 255, 255, 0.9)",
          offset: [-5, -15],
        },
      },
      data: seriesData[0].data,
    },
    {
      type: "bar",
      itemStyle: {
        color: "transparent",
      },
      //  showBackground: true,

      label: {
        normal: {
          show: true,
          position: "top",
          fontSize: 12,
          color: "rgba(255, 255, 255, 0.9)",
          offset: [-7, -15],
        },
      },
      data: seriesData[1].data,
    }
  );
  return data;
}

function getRenderItem(params, api) {

  const index = params.seriesIndex;
  let location = api.coord([api.value(0) + index, api.value(1)]);
  const shape = {
    api,
    xValue: api.value(0) + index,
    yValue: api.value(1),
    x: location[0],
    y: location[1],
    xAxisPoint: api.coord([api.value(0), 0]),
  };
  return {
    type: "group",
    children: [
      {
        position: seriesData[index].position,
        type: "CubeTop",
        shape: shape,
        style: {
          fill: new echarts.graphic.LinearGradient(
            0,
            0,
            0,
            1,
            topColors[index]
          ),
        },
      },
      {
        position: seriesData[index].position,
        type: "CubeLeft",
        shape: shape,
        style: {
          fill: new echarts.graphic.LinearGradient(
            0,
            0,
            0,
            1,
            leftColors[index]
          ),
        },
      },
      {
        position: seriesData[index].position,
        type: "CubeRight",
        shape: shape,
        style: api.style(),
      },
    ],
  };
}


const seriesData = [
  {
    label: "話務(wù)",
    position: [-20, 0],
    data: [386, 247, 298, 476],
  },
  {
    label: "工單",
    position: [-60, 0],
    data: [200, 374, 154, 200],
  },
];

let option = reactive({
  tooltip: {
    show: false,
  },
  xAxis: {
    data: ["投訴", "咨詢", "建議", "保修"],
    axisTick: {
      show: false,
    },
    axisLine: {
      lineStyle: {
        color: "#0b3b67",
        width: 3,
      },
    },
    axisLabel: {
      show: true,
      color: "#fff",
    },
  },

  yAxis: {
    show: true,
    axisLabel: {
      show: false,
    },
    splitNumber: 7,
    splitLine: {
      show: true,
      lineStyle: {
        color: "#0b3b67",
      },
    },
  },
  series: getSeriesData(),
});

echarts實(shí)現(xiàn)3d柱狀圖,人工智能,算法

?文章來源地址http://www.zghlxwxcb.cn/news/detail-833678.html

到了這里,關(guān)于echarts3d柱狀圖的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • echarts3d餅圖

    echarts3d餅圖

    效果圖: 安裝echarts 在package.json文件中添加 如圖 main.js中引入 完整代碼如下(示例): HTML代碼 js腳本代碼 css樣式代碼 如有疑問歡迎留言

    2024年02月12日
    瀏覽(16)
  • echarts3d餅圖,環(huán)形圖(包含透明效果)

    echarts3d餅圖,環(huán)形圖(包含透明效果)

    效果圖: 餅圖: ?? 環(huán)形圖: 帶透明度的環(huán)形圖: 安裝echarts ? \\\"echarts\\\":?\\\"^5.1.2\\\" ?\\\"echarts-gl\\\":?\\\"^2.0.8\\\" .vue文件 【 bindListen方法可以提取到mixins里面,以供組件多次調(diào)用 】 ? chart.js 參考文章:?https://www.cnblogs.com/KaypoGeng/p/14338434.html?(我就是在這個(gè)基礎(chǔ)上優(yōu)化的)

    2024年02月11日
    瀏覽(20)
  • vue3之echarts3D環(huán)柱圖

    vue3之echarts3D環(huán)柱圖

    vue3之echarts3D環(huán)柱圖 效果: 核心代碼:

    2024年01月25日
    瀏覽(30)
  • vue3之echarts3D環(huán)柱餅圖

    vue3之echarts3D環(huán)柱餅圖

    vue3之echarts3D環(huán)柱餅圖 效果: 版本 \\\"echarts\\\": \\\"^5.4.1\\\", \\\"echarts-gl\\\": \\\"^2.0.9\\\" 核心代碼:

    2024年03月25日
    瀏覽(25)
  • echarts 實(shí)現(xiàn) 3d 柱狀圖

    echarts 實(shí)現(xiàn) 3d 柱狀圖

    實(shí)現(xiàn)要求 能夠調(diào)整大小 實(shí)現(xiàn)3d效果,可以改變顏色 前置環(huán)境 效果 調(diào)整大小和顏色 代碼 baseCharts.vue 使用 10.12 更新 效果 代碼 使用

    2024年02月11日
    瀏覽(20)
  • echarts實(shí)現(xiàn)3D柱狀圖(視覺層面)和3D餅圖

    echarts實(shí)現(xiàn)3D柱狀圖(視覺層面)和3D餅圖

    原理: 立體圖形從一個(gè)方向只能看到三個(gè)面,于是我們通過echarts圖表實(shí)現(xiàn) 頂部,明面,和暗面。 效果圖如下: 需要四份數(shù)據(jù), 兩個(gè)柱子的數(shù)據(jù)+X軸數(shù)據(jù)+顏色數(shù)據(jù), 通過 setData 和 setColor 生成需要的數(shù)據(jù),橫向柱狀圖同理,參照代碼中注釋。 以下是完整案例代碼: 3D餅圖沒

    2024年02月16日
    瀏覽(24)
  • vue echarts實(shí)現(xiàn)3D效果柱狀圖

    vue echarts實(shí)現(xiàn)3D效果柱狀圖

    在vue2項(xiàng)目里面,研究了哈,這里記錄下eacharts 實(shí)現(xiàn)3D效果柱狀圖 在main.js引入eacharts 展示效果:大屏demo

    2024年02月15日
    瀏覽(30)
  • vue3 echarts實(shí)現(xiàn)3D立體柱狀圖效果,多柱狀圖

    vue3 echarts實(shí)現(xiàn)3D立體柱狀圖效果,多柱狀圖

    使用插件vchart+echarts5.x按需引入實(shí)現(xiàn) 需要注意下,底下的橢圓,是在柱子底下“透”出來,顏色應(yīng)該暗一點(diǎn),才能視覺上看著有立體感。 成品,還原了大部分設(shè)計(jì)效果

    2024年02月06日
    瀏覽(20)
  • vue使用echarts與echarts-gl實(shí)現(xiàn)3d地圖與 3d柱狀圖

    vue使用echarts與echarts-gl實(shí)現(xiàn)3d地圖與 3d柱狀圖

    目錄 前言 一、下載echarts與echarts gl 二、vue引入與頁面使用 1.引入 2.頁面引入echarts-gl 三、下載地圖數(shù)據(jù) 四、使用地圖 1、html初始化地圖放入位置: 2、data創(chuàng)建變量 3、創(chuàng)建地圖 4、鉤子函數(shù)渲染地圖 5、渲染完成效果 總結(jié) 提示:本項(xiàng)目使用vue,請(qǐng)?zhí)崆按罱ê胿ue項(xiàng)目 本次需求

    2024年02月12日
    瀏覽(27)
  • echarts實(shí)現(xiàn)3d柱狀圖的兩種方式

    echarts實(shí)現(xiàn)3d柱狀圖的兩種方式

    看了不少關(guān)于3d柱狀圖的案例,發(fā)現(xiàn)做3d柱狀圖 常用的兩種方式就是 自定義圖形和象型柱圖, 兩種實(shí)現(xiàn)方式效果如下: 方法1: echarts.graphic.extendShape 自定義圖形 echarts自定義圖形的詳細(xì)用法點(diǎn)這里, 官網(wǎng)點(diǎn)這里, 圖中第一個(gè)3d柱狀圖我參考的案例在這里, 看了很多 echarts這種3d案例,

    2024年02月01日
    瀏覽(25)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包