瀏覽代碼

need:标识区文字换行

shanbinzhang 2 月之前
父節點
當前提交
f24218887f
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/hooks/chart/useChartRender.ts

+ 2 - 1
src/hooks/chart/useChartRender.ts

@@ -2329,13 +2329,14 @@ const setAxisPlotAreas = (axis: number, axisType: any = null) => {
       'middle': 0,
       'bottom': -10
     }
+    let text =  _.text.replace(/\n|\r\n/g, '<br/>');
 
     return {
       from: fromMarkerValue,
       to: toMarkerValue,
       color: _.color,
       label: {
-        text: _.text || "",
+        text,
         verticalAlign: _.textPosition,
         y: positionMapValue[_.textPosition],
         style: {