UNPKG

@opentiny/vue-renderless

Version:

An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.

29 lines (28 loc) 862 B
import "../chunk-G2ADBYYC.js"; import { itemPoint, itemLabel, itemContent } from "../chart-core/deps/constants"; const getTooltip = () => ({ trigger: "item", formatter(item) { const tpl = []; const { name, value, color } = item; if (name) { color && tpl.push(itemPoint(color)); tpl.push(`${itemLabel("label")}${itemContent(name)}`); tpl.push("<br>"); } color && tpl.push(itemPoint(color)); tpl.push(`${itemLabel("sum")}${itemContent(value)}`); return tpl.join(""); } }); const sunburst = (columns, rows, settings, extra) => { const defaultItemStyle = { borderWidth: 2 }; const series = { type: "sunburst", itemStyle: defaultItemStyle }; const { tooltipVisible } = extra; const tooltip = tooltipVisible && getTooltip({}); let options = { series, tooltip }; return options; }; export { sunburst };