echarts3d柱狀圖

//畫立方體三個面
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: "話務",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(),
});

?

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/36925.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/36925.shtml
英文地址,請注明出處:http://en.pswp.cn/news/36925.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

陪診小程序開發|陪診陪護小程序讓看病不再難

陪診小程序通過與醫療機構的合作,整合了醫療資源,讓用戶能夠更加方便地獲得專業醫療服務。用戶不再需要面對繁瑣的掛號排隊,只需通過小程序預約服務,便能夠享受到合適的醫療資源。這使得用戶的就醫過程變得簡單高效,并…

Redis使用規范及優化

緩存設計 緩存方案 普通緩存 查詢數據時,先查找緩存,如果有延長緩存時間并返回。如果沒有,再去查找數據庫,將查詢的數據再寫到緩存,同時設置過期時間。如果是靜態熱點數據,可以不設置緩存失效時間。 冷…

IntelliJ最佳插件

基于 IntelliJ 平臺的 JetBrains IDE 可能是當今最常見的 IDE 之一。它們的受歡迎程度在 JVM 語言社區中尤其明顯,IntelliJ IDEA 仍然是大多數開發人員的首選 IDE。所有這一切都是在一些新競爭對手的出現和老競爭對手克服以前的缺點并重新加入競爭者的情況下實現的。…

【EI/SCOPUS檢索】第三屆計算機視覺、應用與算法國際學術會議(CVAA 2023)

第三屆計算機視覺、應用與算法國際學術會議(CVAA 2023) The 3rd International Conference on Computer Vision, Application and Algorithm 2023年第三屆計算機視覺、應用與算法國際學術會議(CVAA 2023)主要圍繞計算機視覺、計算機應用、計…

PPT顏色又丑又亂怎么辦?

一、設計一套PPT時,可以從這5個方面進行設計 二、PPT顏色 (一)、PPT常用顏色分類 一個ppt需要主色、輔助色、字體色、背景色即可。 (二)、搭建PPT色彩系統 設計ppt時,根據如下幾個步驟,依次選…

Arduino驅動紅外二氧化碳傳感器(氣體傳感器篇)

目錄 1、傳感器特性 2、驅動程序 紅外激光傳感器是將成熟的紅外吸收氣體檢測技術與精密光路設計、精良電路設計緊密結合而制作出的高性能傳感器,具有高靈敏度、高分辨率、低功耗,響應快、抗水汽干擾、不中毒、穩定性高、使用壽命長等特點。本篇博文使用Arduino驅動紅外二氧…

Android學習之路(2) 設置視圖

一、設置視圖寬高 ? 在Android開發中,可以使用LayoutParams類來設置視圖(View)的寬度和高度。LayoutParams是一個用于布局的參數類,用于指定視圖在父容器中的位置和大小。 ? 下面是設置視圖寬度和高度的示例代碼: …

Win10基于 Anaconda 配置 Deeplabcut 環境

最近需要做動物行為學分析的相關研究,同時由于合作者只有 Windows 系統,于是只好在 Windows 中配置環境。說實話還真的是挺折磨的。。。 一、下載 Anaconda 可以通過清華源下載 Anaconda:https://mirrors.tuna.tsinghua.edu.cn/anaconda/ar…

算法leetcode|70. 爬樓梯(rust重拳出擊)

文章目錄 70. 爬樓梯:樣例 1:樣例 2:提示: 分析:題解:rust:go:c:python:java: 70. 爬樓梯: 假設你正在爬樓梯。需要 n 階你才能到達樓…

奧威BI數據可視化工具:報表就是平臺,隨時自助分析

別的數據可視化工具,報表就只是報表,而奧威BI數據可視化工具,一張報表就約等于一個平臺,可隨時展開多維動態自助分析,按需分析,立得數據信息。 奧威BI是一款多維立體分析數據的數據可視化工具。它可以幫助…

電腦xinput1_3.dll丟失的解決方法?哪個解決方法更簡單

最近在打開軟件或者游戲的時候,電腦提示xinput1_3.dll文件丟失的錯誤。這個問題導致我無法運行某些游戲和應用程序。通過一番嘗試和研究,我找到了一些修復xinput1_3.dll文件丟失的方法,并在此分享給大家。 首先,我了解到xinput1_3…

如何使用PHP編寫爬蟲程序

在互聯網時代,信息就像一條無休無止的河流,源源不斷地涌出來。有時候我們需要從Web上抓取一些數據,以便分析或者做其他用途。這時候,爬蟲程序就顯得尤為重要。爬蟲程序,顧名思義,就是用來自動化地獲取Web頁…

NSI45030AT1G LED驅動器方案為汽車外部及內部照明恒流穩流器(CCR)方案

關于線性恒流調節器(CCR):是一種用于控制電流的穩定輸出。它通常由一個功率晶體管和一個參考電流源組成。CCR的工作原理是通過不斷調節功率晶體管的導通時間來維持輸出電流的恒定。當輸出電流超過設定值時,CCR會減少功率晶體管的導…

SAP MM學習筆記20- SAP中的英文2 - SD中英文,日語,中文

SD模塊中的英文,日語,中文 對照。 販売管理 日本語英語中國語受注伝票sales order銷售訂單出荷伝票delivery order交貨訂單ピッキングリストpicking list領貨清單シップメント伝票shipment document發運單據出庫確認post goods issue發貨確認請求伝票b…

紅日ATT&CK VulnStack靶場(三)

網絡拓撲 web階段 1.掃描DMZ機器端口 2.進行ssh和3306爆破無果后訪問web服務 3.已知目標是Joomla,掃描目錄 4.有用的目錄分別為1.php 5.configuration.php~中泄露了數據庫密碼 6.administrator為后臺登錄地址 7.直接連接mysql 8.找到管理員表,密碼加密了…

提高學生學習效率的模擬考試系統

在如今競爭激烈的社會環境下,提高學生的學習效率顯得尤為重要。為了幫助學生評估自己的學習水平并提供有針對性的學習建議,開發一款模擬考試系統是非常必要的。 一、學生信息錄入 模擬考試系統首先需要學生信息錄入功能。學生可以通過一個簡單的表單填…

Unity游戲源碼分享-中國象棋Unity5.6版本

Unity游戲源碼分享-中國象棋Unity5.6版本 項目地址: https://download.csdn.net/download/Highning0007/88215699

【c語言】指針進階(超詳細)

文章目錄 ? 指向函數指針數組的指針📌指向函數指針數組的指針的定義📌指向函數指針數組的數組指針的使用 ?回調函數📌 回調函數的定義📌 回調函數的使用 ?qsort函數📌 qsort函數的作用📌qsort函數的定義…

【佳佳怪文獻分享】安全人機交互的學習責任分配與自動駕駛應用

標題:Learning Responsibility Allocations for Safe Human-Robot Interaction with Applications to Autonomous Driving 作者:Ryan K. Cosner, Yuxiao Chen, Karen Leung, and Marco Pavone 來源:2023 IEEE International Conference on …

1.1 : DNA 螺旋

概述 脫氧核糖核酸(DNA)是負責在所有生物體和大多數病毒中代代相傳性狀的遺傳物質。DNA由兩條相互纏繞形成雙螺旋的核苷酸鏈組成。DNA 結構的發現是在近一個世紀的時間里逐步發現的,代表了科學史上最著名、最迷人的故事之一。 DNA 結構詳細信息 每條 DNA 鏈均由稱為核苷酸…