(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7470466c"],{"2f5ef":function(t,e,a){"use strict";a.r(e);var n=a("7a23");const c={class:"data-designer-chart-instance data-designer-chart-view-pie",ref:"designerChartViewRef"},i={class:"data-designer-chart-container",ref:"designerChartViewInnerRef"};function o(t,e,a,o,r,s){return Object(n["openBlock"])(),Object(n["createElementBlock"])("div",c,[Object(n["createElementVNode"])("div",i,null,512)],512)}var r=a("f04e"),s=a("917c"),l=a("7104"),f=a.n(l),h=a("ec41"),d=a("a955"),b=a("3b20"),u=a("6fde"),O=Object(n["defineComponent"])({props:Object.assign(Object.assign({},b["h"].props),{setChartInstance:{type:Function}}),data(){return{chartType:[d["N"].BASE_PIE,d["N"].PIE_DONUT]}},mixins:[b["h"]],setup(t,{emit:e}){let a=Object(n["ref"])();const c=Object(n["ref"])(null),i=Object(n["ref"])(null);function o(){var e;return a.value=new s["Chart"](Object.assign(Object.assign(Object.assign({},Object(b["f"])()),t.chartCfg||{}),{padding:Object(u["uc"])(t.config)||Object(u["vc"])(t.config)?[]:[50,50,50,50],container:i.value,supportCSSTransform:!0})),a.value.on("element:click",e=>{var a,n;const c=Object(b["w"])(e.data.data,null===(a=t.getCurrentDrillDownConfig)||void 0===a?void 0:a.call(t),t.chartData.id);c&&(null===(n=t.pushBreadcrumbEvent)||void 0===n||n.call(t,c)),Object(b["s"])(t.chartData,t.openDomGoto)}),null===(e=t.setChartInstance)||void 0===e||e.call(t,a),a.value}Object(n["onMounted"])(()=>{o(),Object(b["i"])(c.value,a.value)});let l={};Object(n["watch"])(()=>t.chartData,e=>{var n;e&&a.value&&Object(u["Hc"])(e)&&(t.chartCfg&&t.chartCfg.width&&t.chartCfg.height&&(null===(n=a.value)||void 0===n||n.changeSize(+t.chartCfg.width,t.chartCfg.height)),Object(b["u"])(e,l)?(l=Object(r["U"])(e),p(a.value,e,t.chartDataResult)):l=Object(r["U"])(e))},{immediate:!0,deep:!0});let O={};function g(e,n){O=Object(r["U"])(t.chartDataResult),a.value||o(),p(a.value,e,n)}Object(n["watch"])(()=>t.chartDataResult.data,()=>{Object(u["Kc"])(O,t.chartDataResult)||(c.value?g(t.chartData,t.chartDataResult):Object(n["onMounted"])(()=>{g(t.chartData,t.chartDataResult)}))},{immediate:!0,deep:!0});const j=Object(u["N"])();function p(e,a,n){if(!Object(b["v"])(t.chartData))return;if(!Object(u["Kc"])(a,n.chartData))return;e.clear(),v(e,a);const{scales:i,dimensions:o}=Object(u["Kb"])(t.chartData),r=n.data||[];n&&n.totalSize>d["h"]&&Object(b["t"])(t.chartData,l)&&j();const s=(new f.a.DataView).source(r.length>d["h"]?r.slice(0,d["h"]):r);if(o&&o.length&&i&&i.length){const t=o[0],e=i[0];s.transform({type:"impute",field:e.chartField.displayName,method:"value",value:0}),s.transform({type:"percent",field:e.chartField.displayName,dimension:t.chartField.displayName,as:d["e"]})}e.data(s.rows),e.render(),Object(u["tc"])(a)&&Object(b["i"])(c.value,e)}function v(e,a){e||(e=o());const{scales:n,dimensions:c}=Object(u["Kb"])(t.chartData);if(n.length&&e.scale){const a=Object(u["V"])(t.chartData);e.scale(a)}if(c.length&&n.length&&e.interval){const a=c[0].chartField.displayName,n=d["m"],i=e.interval().position(n).color(a).adjust("stack");Object(u["r"])(e,t.config,t.chartData,i)}if(!e.tooltip)return;e.tooltip({showTitle:!1,showMarkers:!1,showNil:!0,customItems:e=>Object(u["Eb"])(e,t.chartData)}),Object(u["s"])(e,t.config,t.chartData),Object(u["n"])(e,t.config,t.chartData,c&&c.length&&c[0].chartField||void 0,n&&n.length&&n[0].chartField||void 0),e.coordinate("theta",{radius:.75,innerRadius:a.chartTemplateCode===d["N"].PIE_DONUT?.6:0});const i=Object(h["a"])(a,"chartStyleObj.labelStyle")||{};if(a.chartTemplateCode===d["N"].PIE_DONUT&&i.inRingCanShow){const a={offsetX:0,offsetY:-20},n={offsetX:0,offsetY:20},c=d["I"].LEFT===i.inRingTitleLocation;d["I"].BOTTOM===i.inRingTitleLocation?(a.offsetY=20,n.offsetY=-20):c&&(a.offsetX=-4,a.offsetY=0,n.offsetX=4,n.offsetY=0);const o={fontSize:i.inRingTitleFontSize||14,fill:i.inRingTitleFontColor||"#333333",textAlign:c?"end":"center"},r={fontSize:i.inRingContentFontSize||12,fill:i.inRingContentFontColor||"#666666",textAlign:c?"start":"center"};if(Object(u["Wc"])(t.config)){const e=Object(u["Ub"])(t.config);o.fill=e.colorCfg.main,o.fontSize=e.fontSize,r.fill=e.colorCfg.sub,r.fontSize=e.fontSize+2}e.annotation().text(Object.assign(Object.assign({},a),{position:["50%","50%"],content:i.inRingTitle,style:Object.assign({},o)})).text(Object.assign(Object.assign({},n),{position:["50%","50%"],content:i.inRingContent,style:Object.assign({},r)}))}Object(u["qd"])(e,a,t.config)}return Object(b["E"])(t,a,v),Object(b["D"])(t,a),Object(n["onBeforeUnmount"])(()=>{a.value.off()}),{designerChartViewRef:c,designerChartViewInnerRef:i,chart:a}}}),g=a("6b0d"),j=a.n(g);const p=j()(O,[["render",o]]);e["default"]=p}}]);