Home forums Feature Requests & Feedback Multiple data in a dynamic way possible?

This topic contains 0 replies, has 1 voice, and was last updated by  marokino1 1 year, 6 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #8987

    marokino1
    Member

    here is my code :

    function getData(){
    var projects = [“SFR” , “MANAGEMENT”];
    var projects_results = [];
    var mehdi= [];
    var obj = [];
    $.each(projects , function(n) {
    $.ajax({
    url: “php/charger.php”,
    data: “projet=”+ projects[n],
    type: “POST”,
    success : function (result) {
    obj = [{type : “column”} , {lineThickness : 3} , {axisYType:”secondary”} , {showInLegend:true} , {name: projects[n]} , {dataPoints: $.parseJSON(result)} , {“” : “,”}] ;
    displayChart(obj);
    }
    });
    });
    }

    function displayChart(datapointss){
    var chart = new CanvasJS.Chart(“chartContainer”,
    {
    zoomEnabled: false,
    animationEnabled: true,
    title:{
    text: “PROJECTS”
    },
    axisY2:{
    valueFormatString:”0.0 days”,

    // maximum: 1.2,
    // interval: .2,
    interlacedColor: “#F5F5F5”,
    gridColor: “#D7D7D7”,
    tickColor: “#D7D7D7”
    },
    theme: “theme2”,
    toolTip:{
    shared: true
    },
    legend:{
    verticalAlign: “bottom”,
    horizontalAlign: “center”,
    fontSize: 15,
    fontFamily: “Lucida Sans Unicode”

    },
    data:
    datapointss
    ,
    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();

    }

    help me !! thank you in advance

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.