实现效果:
<template>
<div class="KeyPoint">
<div id="KeyPointChart" style="flex: 1; height: 280px; width: 614px; padding-left: 10px"></div>
</div>
</template>
<script>
import {
getPeopleLive } from '@/api/government';
export default {
data() {
return {
keyCategoryDataName: [], //品类名称
keyCategoryDataValue: [], //品类值
};
},
mounted() {
const myShape = {
x: 0,
y: 0,
width: 13, //柱宽
};
// 绘制左侧面
const InclinedRoofColumn = this.$echarts.graphic.extendShape({
shape: myShape,
buildPath: function (ctx, shape) {
const xAxisPoint = shape.xAxisPoint;
const c0 = [shape.x, shape.y];
const c1 = [shape.x - 17, shape.y - 12];
const c2 = [xAxisPoint[0] - 17, xAxisPoint[1]];
const c3 = [xAxisPoint[0], xAxisPoint[1]];
ctx.moveTo(c0[0