Home forums Using CanvasJS Why same label on chart not display label on x axis

This topic contains 2 replies, has 2 voices, and was last updated by  triiglobal 1 week ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #23332

    triiglobal
    Member

    <!DOCTYPE HTML>
    <html>
    <head>
    <script type=”text/javascript”>
    window.onload = function () {
    var chart = new CanvasJS.Chart(“chartContainer”, {
    title: {
    text: “Understanding Labels”
    },
    axisY: {
    labelFontSize: 20,
    labelFontColor: “dimGrey”
    },
    axisX: {
    labelAngle: -30
    },
    data: [
    {
    type: “column”,
    dataPoints: [
    { y: 10, label: “Apples” },
    { y: 15, label: “Mangos” },
    { y: 25, label: “Oranges” },
    { y: 30, label: “Grapes” },
    { y: 10, label: “Apples” },
    { y: 15, label: “Mangos” },
    { y: 25, label: “Oranges” },
    { y: 30, label: “Grapes” },
    { y: 10, label: “Apples” },
    { y: 15, label: “Mangos” },
    { y: 25, label: “Oranges” },
    { y: 30, label: “Grapes” },
    { y: 28, label: “Bananas” }
    ]
    }
    ]
    });

    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>

    #23338

    Priyanka M S
    Member

    @triiglobal,

    Setting interval: 1 in axisX will show all labels.

    If this doesn’t solve your requirement, kindly brief us further about it and share a JSFiddle reproducing the issue you are facing(if any) so that we can understand your requirement better and help you out.

    __
    Priyanka M S
    Team CanvasJS

    #23418

    triiglobal
    Member

    thanks is work.

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

You must be logged in to reply to this topic.