在canvas.js中为多纳图制作标签索引多行

时间:2019-05-30 07:24:56

标签: javascript canvasjs

我正在使用canvas.js库来生成列数据。

var chart = new CanvasJS.Chart("<%=BankBalanceChartContainer.ClientID%>", {
            //colorSet: "chartdatacolor",
            theme:  "light2",
             exportFileName: "Doughnut Chart",
            exportEnabled: true,            
            animationEnabled: true,
            legend:{
                cursor: "pointer",
                itemclick: explodePie
            },
            axisX: {
                valueFormatString: "MMM YYYY",
                interval: 1,
                intervalType: "month"
            },
            axisY: { 
                 valueFormatString: "$#,##0.##",
            },           
            legend:{
                cursor: "pointer",
                itemclick: explodePie
            },
            toolTip:{   
                content: "{name}: "+ billingcurrency +" {y}"      
            },
            data: [
            {

                type: "doughnut",
                radius: 100,
                innerRadius: 50,    
                showInLegend: true,        
                indexLabel: " {label}",
                indexLabelFontSize: 12,
                dataPoints: dataArray,
            }
            ]
        });

        chart.render();
标签中的

甜甜圈 显示为:
美国100.00
125.00新元

不使用indexLabelMaxWidth和indexLabelWrap。
使用Dom元素br

0 个答案:

没有答案