当前位置: 首页 > wzjs >正文

wordpress时尚英文站设计网站模板

wordpress时尚英文站,设计网站模板,单位做网站怎么做,wordpress 画廊 插件主要功能 数据可视化:以堆叠柱形图形式展示两组数据(销售和技术)的月度分布情况。响应式设计:图表会根据窗口大小自动调整。数据交互:鼠标悬停时显示详细数据(包括每项的具体数值和总计)。数据更…

主要功能

  1. 数据可视化:以堆叠柱形图形式展示两组数据(销售和技术)的月度分布情况。
  2. 响应式设计:图表会根据窗口大小自动调整。
  3. 数据交互:鼠标悬停时显示详细数据(包括每项的具体数值和总计)。
  4. 数据更新:当传入的 props 数据变化时,图表会自动更新。

 组件代码

<template><div class="chart-container" ref="chartRef"></div>
</template><script setup>
import { ref, onMounted, watch } from "vue";
import * as echarts from "echarts";const props = defineProps({// 接收秘密和机密数据secretData: {type: Array,default: () => [],},confidentialData: {type: Array,default: () => [],},// 可选:自定义标题title: {type: String,default: "堆叠柱形图",},// 可选:自定义x轴标签xAxisLabels: {type: Array,default: () => ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月",],},
});const chartRef = ref(null);
let chartInstance = null;// 初始化图表
const initChart = () => {if (!chartRef.value) return;chartInstance = echarts.init(chartRef.value);const option = {backgroundColor: "#fff",title: {text: props.title,left: "center",textStyle: {color: "#333",fontSize: 16,},},tooltip: {trigger: "axis",axisPointer: {type: "cross",crossStyle: {color: "#999",},},formatter: (params) => {let result = `<div class="font-bold">${params[0].name}</div>`;let total = 0;params.forEach((param) => {total += param.value;result += `<div class="flex items-center"><span class="inline-block w-3 h-3 rounded-full mr-2" style="background-color: ${param.color}"></span>${param.seriesName}: ${param.value}</div>`;});result += `<div class="font-bold mt-1">总计: ${total}</div>`;return result;},},legend: {data: ["销售", "技术"],top: "5%",right: "0",itemWidth: 10,itemHeight: 10,},grid: {left: "3%",right: "4%",bottom: "3%",containLabel: true,},xAxis: {type: "category",data: props.xAxisLabels,axisTick: false,axisLabel: {color: "#999999",},axisLine: {show: true, // 显示轴线lineStyle: {color: "#DDDDDD", // 轴线颜色width: 1, // 轴线宽度type: "solid", // 轴线样式:solid, dashed, dotted},},},yAxis: {type: "value",min: 0,axisLabel: {formatter: "{value}",color: "#999999",},splitLine: {show: false, // 隐藏y轴横线(网格线)},},series: [{name: "销售",type: "bar",stack: "总量",data: props.secretData,color: "#FC1705",barWidth: "30%",},{name: "技术",type: "bar",stack: "总量",data: props.confidentialData,color: "#970E02",barWidth: "30%",},],};chartInstance.setOption(option);// 监听窗口大小变化,调整图表window.addEventListener("resize", () => {if (chartInstance) chartInstance.resize();});
};// 初始化和更新图表
onMounted(() => {initChart();
});// 监听props变化,更新图表
watch([() => props.secretData, () => props.confidentialData], () => {if (chartInstance) {chartInstance.setOption({series: [{data: props.secretData,},{data: props.confidentialData,},],});}
});// 组件卸载时销毁图表
onUnmounted(() => {if (chartInstance) {chartInstance.dispose();chartInstance = null;}
});
</script><style scoped>
.chart-container {width: 100%;height: 360px;margin: 0 auto;
}
</style>

组件引用

<StackedBarChart:secretData="[0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0]":confidentialData="[0, 0, 0, 0, 0, 251, 0, 0, 0, 0, 0, 0]"
/>

http://www.dtcms.com/wzjs/225545.html

相关文章:

  • 做网站自己买服务器百度搜索引擎网址
  • 外贸网站建设教程网站seo排名优化方法
  • 模板网站建设优惠合肥网站建设
  • 域名注册后 免费自建网站哈尔滨最新疫情通报
  • 广州做地铁的公司网站查收录网站
  • 网站后台登陆网址是多少域名注册网站系统
  • wordpress评论自定义太原seo优化公司
  • 中国十大网站开发公司一键免费生成网页的网站
  • 如何配置php网站网站下载
  • 南山做网站的公司怎么做百度网页
  • 做任务领积分兑换别的网站上的会员苏州seo优化公司
  • 三亚网站开发seo是啥
  • 推广网站wap端怎么做百度自动驾驶技术
  • wordpress插件原理上海搜索引擎优化1
  • 管理手机网站模板深圳网络推广服务公司
  • 深圳网站建设seo如何在google上免费推广
  • 购物网站html网站建设公司简介
  • 男科医院网站建设策略百度查询入口
  • dede网站地图模板下载网站推广渠道
  • 电子商务网站建设目的百度指数app官方下载
  • 豆瓣网站是怎么建设的营销推广外包公司
  • 网站开发 调试济南seo优化外包
  • 做瞹瞹爱免费网站地推接单在哪个平台找
  • web前端设计模板南京百度seo排名
  • 建站比较好的公司五个常用的搜索引擎
  • 外贸推广网站邮箱收费100个免费推广b站
  • 哪个网站专业做代购护肤品关键字有哪些
  • 网站开发的背景的讲解网站建设方案模板
  • 网站建设东营百度seo排名教程
  • 科技企业网站制作营销软文代写