Forum Replies Created by rafdu01

Viewing 3 posts - 1 through 3 (of 3 total)
  • in reply to: number after the decimal point #44108

    I want my graph to display numbers with a decimal point, for example 9.6, 9.7. currently the line on my graph goes from 6 to 7 even if my figure is 6.4.

    in reply to: number after the decimal point #44099

    Thanks for your help but it doesn’t work.

    Link graph

    Here is my code:

    window.onload = function () {
    	var chart = new CanvasJS.Chart("chartContainer",
    	{ backgroundColor: "#D5DBDB",
     interactivityEnabled: false,	 
    	 zoomEnabled: false,
          zoomType: "x",
          title:{
            text: "Graphique vent "
          },
    		title:{
    			text:"Graphique Vent",
    		},
    		axisX: {
    		labelAutoFit: true,				
            interval: 50,
    		title: "",
    		crosshair: {
            enabled: false
          }
    	},
    	axisY: {
    		valueFormatString: "#0.0",		
    		title: "Km/h",
    		 interval: 0.1,
    	},
    
    		data: [{
    			type: "spline",
     color: "red",
    			dataPoints : [],
    		},
    		]
    	});
    
    	function updateChart() {
    		$.getJSON("service2.php", function(data) {		
    			chart.options.data[0].dataPoints = [];
    			$.each((data), function(key, value){
    			
    				chart.options.data[0].dataPoints.push({label: value[0], y: parseInt(value[1])
    				})
    				if (chart.options.data[0].dataPoints.length > 350 ) {
       chart.options.data[0].dataPoints.shift();
     };					
    			});	
    
    			chart.render();
    			
    			updateChart();
    		});
    	}
    
    	setInterval(function(){updateChart()}, 2000);
    		 
    }
    in reply to: Shift live graph #40009

    Hello,
    Thank you very much it works.

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