Home Forums Chart Support Chart type:pie, not all label are visible

Chart type:pie, not all label are visible

Viewing 4 posts - 1 through 4 (of 4 total)
  • #25718

    Hello, i use Chart type pie. But not all label are visible
    Can you me help please?
    Thanks

    Here is my HTML

    <!DOCTYPE HTML>
    <html>
    <head>
    <script type="text/javascript">
    window.onload = function () {
    	var chart = new CanvasJS.Chart("chartContainer",
    	{
    		title:{
    			text: "Where is label5 ?"
    		},
    		
    		data: [
    		{
    			type: "pie",
    			
    			legendText: "{indexLabel}",
    			dataPoints: [{"y":3.52941179,"label":"label1"},
    			{"y":4.70588255,"label":"label2"},
    			{"y":58.82353,"label":"label3"},
    			{"y":10.5882359,"label":"label4"},
    			{"y":4.70588255,"label":"label5"},// > 6.70588255 ok
    			{"y":17.6470585,"label":"label6"}
    			]
    		}
    		]
    	});
    	chart.render();
    }
    </script>
    <script type="text/javascript" src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
    </head>
    <body>
    <div id="chartContainer" style="height: 300px; width: 100%;"></div>
    </body>
    </html>
    • This topic was modified 5 years, 5 months ago by Vlad.
    • This topic was modified 3 years, 3 months ago by Manoj Mohan.
    #25720

    Here is my JSFiddle
    https://jsfiddle.net/cjopyL1m/

    #25736

    @vlad,

    IndexLabels / labels in Pie Chart are skipped whenever they get closer to other indexLabels – this behavior is by design. You can workaround this issue by rotating the Pie Chart by setting startAngle as shown in this JSFiddle.


    Vishwas R
    Team CanvasJS

    #25741

    Thank you very much, you helped me!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.