Commit b910a8b3 by 唐玉峰

疾病分组

parent e570dbf8
import { nextTick } from '@vue/composition-api';
import * as echarts from 'echarts';
import { nextTick } from "@vue/composition-api";
import * as echarts from "echarts";
/**
* @param echarts初始化
......@@ -11,79 +9,77 @@ import * as echarts from 'echarts';
export function initEcharts(option, panelId) {
var svChart;
return nextTick(() => {
svChart = echarts.getInstanceByDom(document.getElementById(panelId));
if (svChart == null) {
svChart = echarts.init(document.getElementById(panelId));
}
document.getElementById(panelId).setAttribute('_echarts_instance_', '');
document.getElementById(panelId).setAttribute("_echarts_instance_", "");
svChart.clear();
svChart.setOption(option);
svChart.resize();
// 屏幕大小改变
window.addEventListener('resize', () => {
window.addEventListener("resize", () => {
svChart.resize();
});
return svChart;
})
});
}
//百分比图 智能分组
export function categoryChart(data, tcolor) {
const option = {
title: [{
title: [
{
text: data + `%`,
x: 'center',
top: '38%',
x: "center",
top: "38%",
textStyle: {
fontSize: '16', //百分比的样式
fontSize: "16", //百分比的样式
color: tcolor,
fontFamily: 'Arial',
foontWeight: '600',
fontFamily: "Arial",
foontWeight: "600",
},
},
},],
],
polar: {
radius: ['100%', '60%'],
center: ['50%', '50%'],
radius: ["100%", "60%"],
center: ["50%", "50%"],
},
angleAxis: {
max: 100,
show: false,
},
radiusAxis: {
type: 'category',
type: "category",
show: false,
},
series: [{
name: '',
type: 'bar',
series: [
{
name: "",
type: "bar",
roundCap: true,
barWidth: 6,
showBackground: true,
backgroundStyle: {
color: '#f3fafd', //留白颜色
color: "#f3fafd", //留白颜色
},
data: [data],
coordinateSystem: 'polar',
coordinateSystem: "polar",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
offset: 0,
color: tcolor, //填色颜色
},]),
},
]),
},
},
},],
},
],
};
return option;
......@@ -92,62 +88,67 @@ export function categoryChart(data, tcolor) {
//百分比图 病案入组
export function categoryChart11(text, data, tcolor) {
const option = {
title: [{
title: [
{
text: text,
x: 'center',
top: '52%',
x: "center",
top: "52%",
textStyle: {
fontSize: '14', //百分比的样式
fontSize: "14", //百分比的样式
color: tcolor,
fontFamily: 'PingFang SC',
foontWeight: '300',
fontFamily: "PingFang SC",
foontWeight: "300",
},
},
{
text: data + `%`,
x: 'center',
top: '28%',
text: data ? data : 0 + `%`,
x: "center",
top: "28%",
textStyle: {
fontSize: '20', //百分比的样式
fontSize: "20", //百分比的样式
color: tcolor,
fontFamily: 'Arial',
foontWeight: '600',
fontFamily: "Arial",
foontWeight: "600",
},
},
],
polar: {
radius: ['100%', '60%'],
center: ['50%', '50%'],
radius: ["100%", "60%"],
center: ["50%", "50%"],
},
angleAxis: {
max: 100,
show: false,
},
radiusAxis: {
type: 'category',
type: "category",
show: false,
},
series: [{
name: '',
type: 'bar',
series: [
{
name: "",
type: "bar",
roundCap: true,
barWidth: 6,
showBackground: true,
backgroundStyle: {
color: '#f3fafd', //留白颜色
color: "#f3fafd", //留白颜色
},
data: [data],
coordinateSystem: 'polar',
coordinateSystem: "polar",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
{
offset: 0,
color: tcolor, //填色颜色
},]),
},
]),
},
},],
},
},
],
};
return option;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment