Home Forums Report Bugs Graph is not working when you have only 2 data sets

Graph is not working when you have only 2 data sets

Viewing 2 posts - 1 through 2 (of 2 total)
  • #11330

    HI Support,

    Please see the code below,

    The second data is does not display correctly, each value is 18 (as its a target)

    But on the graph the values with 18 are showing higher for all 3.

    also the scale on the left goes 0,10,20,30 but the scale on the right goes 0,5,10,15,20

    ?

    Can you help please

    Thanks

    Andy

    var chart = new CanvasJS.Chart(‘chartContainer2’,
    {
    theme: ‘theme3’,
    animationEnabled: true,
    title:{
    text: ‘ASCOFA1 – Permanent Admissions of younger adults (aged 18 to 64) to residential and nursing care homes. per 100,000 population’,
    fontSize: 15
    },
    toolTip: {
    shared: true
    },
    axisY: {
    title: ”
    },
    axisY2: {
    title: ”
    },
    data: [{
    type: ‘column’,
    name: ‘Yr End 2015/15’,
    legendText: ‘OutTurn’,
    showInLegend: true,
    dataPoints:[
    {label: ‘Year End 2014/15’, y: 23},
    {label: ‘Qtr 2 2015/16’, y: 12},
    {label: ‘Year End 2015/16’, y: 0}]
    },{
    type: ‘column’,
    name: ‘Target’,
    legendText: ‘Target 15-16’,
    axisYType: ‘secondary’ ,
    showInLegend: true,
    dataPoints:[
    {label: ‘Year End 2014/15’, y: 18},
    {label: ‘Qtr 2 2015/16’, y: 18},
    {label: ‘Year End 2015/16′, y: 18}]
    }],
    legend:{
    cursor:’pointer’,
    itemclick: function(e){
    if (typeof(e.dataSeries.visible) === ‘undefined’ || e.dataSeries.visible) {
    e.dataSeries.visible = false;
    }
    else {
    e.dataSeries.visible = true;
    }
    chart.render();
    }
    },
    });
    chart.render();

    #11331

    Fixed

    was to do with the secondary axisYType

    axisYType: ‘secondary’ ,

    Thanks

    Andy

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

You must be logged in to reply to this topic.