Home Forums Report Bugs where do I make mistakes?

where do I make mistakes?

Viewing 4 posts - 1 through 4 (of 4 total)
  • #19906

    I make a mistake in the code somewhere. but I can not produce a solution. y axis time, x axis angle, y2 axis will get a percentage value. coding is on the following page.

    http://jsfiddle.net/5druj8br/25/

    #19908

    I found the coding error. I still can not produce a solution. Maybe you can help? Error in the following encoding:

    createPareto();	
    function createPareto(){
    	var dps = [];
    	var yValue, yTotal = 0, yPercent = 0;
    
    	for(var i = 0; i < chart.data[0].dataPoints.length; i++)
          {
    		yTotal += chart.data[0].dataPoints[i].y; 
      }
      
    	for(var i = 0; i < chart.data[0].dataPoints.length; i++){
    		yValue = chart.data[0].dataPoints[i].y;
    		yPercent += (yValue /yTotal  * 100);
    		dps.push({label: chart.data[0].dataPoints[i].label, y: yPercent});
    	}
    	
    	chart.addTo("data",{type:"line", yValueFormatString: "0.##\"%\"", dataPoints: dps});
    	chart.data[1].set("axisYType", "secondary", false);
    	chart.axisY[0].set("maximum", yTotal);
    	chart.axisY2[0].set("maximum", 100);
    }
    #19912

    @altayolcay,

    Please take a look at this updated jsfiddle.

    ___________
    Indranil Deo,
    Team CanvasJS

    #19913

    thank you so much. It was what I wanted. thank you.

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

You must be logged in to reply to this topic.