Home Forums Report Bugs problem with axis label when creating the chart with first element

problem with axis label when creating the chart with first element

Viewing 3 posts - 1 through 3 (of 3 total)
  • #4507

    izv

    When I create dynamically a chart, the first axis label isn’t correct. But when I push the second and next points, it is correct.

    Here is the complete code:

    <!DOCTYPE html>

    <html lang=”en”>

    <head>

    <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″/>

    <title>canvasJS</title>

    <script src=”canvasjs.js”></script>

    <script>

    window.onload=function(){

    var data = [];

    var serie = {type: ‘column’, name: ‘example’, showInLegend: true};

    var points = [];

    serie.dataPoints = points;

    data.push(serie);

    var chart = new CanvasJS.Chart(‘canvasjs’,{

    title:{

    text: ‘title’

    },

    data: data

    });

    chart.render();

    var bt1 = document.getElementById(“add1”);

    var bt2 = document.getElementById(“add2″);

    bt1.onclick=function(){

    var point = {label:”first”, y: 30};

    points.push(point);

    chart.render();

    }

    bt2.onclick=function(){

    var point = {label:”second”, y: 60};

    points.push(point);

    chart.render();

    }

    }

    </script>

    </head>

    <body>

    <div id=”canvasjs” style=”height: 300px; width: 100%;”></div>

    <div>

    <input type=”button” id=”add1″ value=”add first” />

    <input type=”button” id=”add2″ value=”add second” />

    </div>

    </body>

    </html>

    #4521

    izv,

    We were able to reproduce the issue. Will be fixing it at the earliest – in a day or two.

    #4610

    izv,

    Just wanted to inform you that the latest version contains a fix for this issue. Do update.

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

You must be logged in to reply to this topic.