Forum Replies Created by altayolcay

Viewing 2 posts - 1 through 2 (of 2 total)
  • in reply to: where do I make mistakes? #19913

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

    in reply to: where do I make mistakes? #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);
    }
Viewing 2 posts - 1 through 2 (of 2 total)