UNPKG

@huyuchen/visual

Version:

## 组件环境

133 lines (132 loc) 2.86 kB
import u from "../BaseChart/index.vue.js"; import t from "../BaseChart/config.js"; import { computed as s, resolveComponent as p, openBlock as d, createBlock as x } from "vue"; import a from "lodash.merge"; import m from "../_virtual/_plugin-vue_export-helper.js"; const y = { name: "HuLineChart", components: { BaseChart: u }, props: { data: { type: [Object, Array], default: () => ({}) }, /** * [{name:'', data: [], ...}] */ series: { type: Array, default: () => [] }, /** * 图例配置 */ legendOption: { type: Object, default: () => ({ right: "auto", top: "10", orient: "horizontal", textStyle: { fontSize: 10, color: "#ffffff" } }) }, /** * colors 自定义颜色 */ colors: { type: Array, default: () => [] }, /** * 横坐标 */ xAxis: { type: Array, default: () => t.xAxisTime }, xAxisOther: { // x轴的其它配置 type: Object, default: () => ({}) }, yAxisOther: { // y轴的其它配置 type: Object, default: () => ({}) }, otherOption: { type: Object, default: () => ({}) } }, setup(e) { const n = s(() => { const c = e.series.map((r, f) => ({ ...o(i[f]), ...r })), l = { tooltip: { trigger: "axis" }, legend: t.legend(e.legendOption), grid: { bottom: "5%", left: "5%", right: "5%", top: "50", containLabel: !0 }, xAxis: [ a( { type: "category", boundaryGap: !1, data: e.xAxis, // ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], axisLabel: { color: "#aac5e1" } }, e.xAxisOther ) ], yAxis: [ a( { type: "value", axisLabel: { color: "#aac5e1" }, axisLine: { show: !0, lineStyle: { color: "#aac5e1" } }, splitLine: { show: !1 } }, e.yAxisOther ) ], series: c, color: e.colors.concat(t.colors) }; return a(l, e.otherOption); }), i = s(() => e.colors.concat(t.colors)), o = () => ({ name: e.name, type: "line", data: e.data }); return { option: n }; } }; function h(e, n, i, o, c, l) { const r = p("base-chart"); return d(), x(r, { option: o.option }, null, 8, ["option"]); } const L = /* @__PURE__ */ m(y, [["render", h]]); export { L as default };