Home forums Report Bugs Stacked bar chart index total not correct with mix of positive & negative valueu

This topic contains 1 reply, has 2 voices, and was last updated by  Bivek Singh 1 month, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15404

    rs
    Member

    With a mix of positive and negative values in a stacked bar chart… the total index label is wrong… it appears to treat all the negative values as positive producing the wrong total… The problem is in the Other Row…. in the example below
    $(function () {
    var chart = new CanvasJS.Chart(“chartContainer”, {
    title: {
    text: “Orders”
    },
    animationEnabled: true,
    axisY2: {
    valueFormatString: “$ 0”,
    },
    toolTip: {
    shared: true
    },
    legend: {
    cursor: “pointer”,
    verticalAlign: “top”,
    itemclick: function (e) {
    if (typeof (e.dataSeries.visible) === “undefined” || e.dataSeries.visible) {
    e.dataSeries.visible = false;
    }
    else {
    e.dataSeries.visible = true;
    }
    chart.render();
    }
    },
    subtitles: [
    {
    text: “Click on Legends to Enable/Disable DataSeries”
    }
    ],

    data: [
    {
    type: “stackedBar”,
    showInLegend: true,
    name: “Q1”,
    axisYType: “secondary”,
    color: “#7E8F74”,
    dataPoints: [{“y”:0.4,”label”:”Accessory (BCS)”},{“y”:3.8,”label”:”Integrity”},{“y”:0.8,”label”:”NonStop”},{“y”:0.1,”label”:”Pre Integrity”},{“y”:4.4,”label”:”Scale-Up x86″},{“y”:0.6,”label”:”Other”}] },
    {
    type: “stackedBar”,
    showInLegend: true,
    name: “Q2”,
    axisYType: “secondary”,
    color: “#F0E6A7”,
    dataPoints: [{“y”:0.2,”label”:”Accessory (BCS)”},{“y”:3,”label”:”Integrity”},{“y”:4.2,”label”:”NonStop”},{“y”:0,”label”:”Pre Integrity”},{“y”:5.1,”label”:”Scale-Up x86″},{“y”:0.5,”label”:”Other”}] },
    {
    type: “stackedBar”,
    showInLegend: true,
    name: “Q3”,
    axisYType: “secondary”,
    color: “#EBB88A”,
    dataPoints: [{“y”:0.3,”label”:”Accessory (BCS)”},{“y”:6.6,”label”:”Integrity”},{“y”:4.8,”label”:”NonStop”},{“y”:0,”label”:”Pre Integrity”},{“y”:3.4,”label”:”Scale-Up x86″},{“y”:0,”label”:”Other”}] },
    {
    type: “stackedBar”,
    showInLegend: true,
    name: “Q4”,
    axisYType: “secondary”,
    color: “#EBB83A”,
    dataPoints: [{“y”:0.3,”label”:”Accessory (BCS)”},{“y”:4,”label”:”Integrity”},{“y”:6.8,”label”:”NonStop”},{“y”:0.1,”label”:”Pre Integrity”},{“y”:3.4,”label”:”Scale-Up x86″},{“y”:0.1,”label”:”Other”}] },
    {
    type: “stackedBar”,
    showInLegend: true,
    name: “Q5”,
    axisYType: “secondary”,
    color: “#EBB885”,
    dataPoints: [{“y”:0.3,”label”:”Accessory (BCS)”},{“y”:4.3,”label”:”Integrity”},{“y”:2.4,”label”:”NonStop”},{“y”:0,”label”:”Pre Integrity”},{“y”:4.1,”label”:”Scale-Up x86″},{“y”:-0.3,”label”:”Other”}] },
    {
    type: “stackedBar”,
    showInLegend: true,
    name: “Q6”,
    axisYType: “secondary”,
    color: “#DB9079”,
    indexLabel: “$#total”,
    indexLabelPlacement: “outside”,
    dataPoints: [{“y”:0.3,”label”:”Accessory (BCS)”},{“y”:5.3,”label”:”Integrity”},{“y”:15.5,”label”:”NonStop”},{“y”:0.1,”label”:”Pre Integrity”},{“y”:4.6,”label”:”Scale-Up x86″},{“y”:-3.3,”label”:”Other”}] }
    ]
    });
    chart.render();
    });
    </script>

    #15431

    Bivek Singh
    Moderator

    @rs

    Thank you for reporting this. We are looking into the issue and will get back to you at the earliest.

    —-
    Bivek Singh,
    Team CanvasJS

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

You must be logged in to reply to this topic.