Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Multiple Charts with unknown count #24678

    NVM I found a similar fiddle here that helped a ton for anyone reading this. https://jsfiddle.net/862dpfLw/

    in reply to: Multiple Charts with unknown count #24672

    If it helps this is the javascript for the chart I want multiple of…

    var chart = new CanvasJS.Chart(“BudgetGoal”, {
    animationEnabled: true,
    backgroundColor: “#F0F0F0″,
    //height of bar (eliminates whitespace)
    height: 100,
    //width of bar
    dataPointWidth: 30,
    axisX: {
    //hide axis label (need both of these)
    tickLength: 0,
    labelFormatter: function(){
    return ” “;
    }
    },
    axisY: {
    prefix: “$”,
    //sets budget goal max
    lineThickness: 0,
    maximum: 200 <== variable that will differ
    },
    toolTip: {
    shared: true
    },
    legend:{
    cursor: “pointer”,
    itemclick: toggleDataSeries
    },
    data: [{
    type: “stackedBar”,
    name: “Spent”,
    yValueFormatString: “$#,##0″,
    color:”red”,
    dataPoints: [
    { label: “Shopping (3/15/18 – 4/15/18)”, y: 90 } <== variables that will differ
    ]
    },
    {
    type: “stackedBar”,
    name: “Money left”,
    //showInLegend: “true”,
    //xValueFormatString: “DD, MMM”,
    yValueFormatString: “$#,##0″,
    color:”#808080”,
    dataPoints: [
    { label: “Shopping (3/15/18 – 4/15/18)”, y: 110 } <== variables that will differ
    ]
    },
    ]
    });
    chart.render();

    and here is the div tag in the html
    <div id=”BudgetGoal” style=”height: 100px; width: 100%;”></div>

    • This reply was modified 1 year, 5 months ago by dillonw777.
Viewing 2 posts - 1 through 2 (of 2 total)