Home forums Using CanvasJS Chart type:pie, not all label are visible

This topic contains 3 replies, has 2 voices, and was last updated by  Vlad 4 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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://canvasjs.com/assets/script/canvasjs.min.js”></script>
    </head>
    <body>
    <div id=”chartContainer” style=”height: 300px; width: 100%;”></div>
    </body>
    </html>

    • This topic was modified 4 months, 1 week ago by  Vlad.
    #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.