Home Forums Chart Support Points in the chart doesn't appear

Points in the chart doesn't appear

Viewing 3 posts - 1 through 3 (of 3 total)
  • #22156

    Hi everyone, I have this problem with the JSP-Chart. When I try to show the chart It appears the structure but not the points inside.

    	window.onload = function () {
    	   
    		var data = [];
    		var dataSeries = { type: "line" };
    		var dataPoints = ${antennasPerModel};
    		dataSeries.dataPoints = dataPoints;
    		data.push(dataSeries);
    		 
    		var options = {
    			exportEnabled: true,
    			animationEnabled: true,
    			title: {
    				text: "Antenna"
    			},
    			axisY: {
    				includeZero: false,
    				lineThickness: 1
    			},
    			data: data
    		};
    		 
    		var chart = new CanvasJS.Chart("chartContainer", options);
    		chart.render(); 
    		}
    

    This is my code. The value that I received in dataPoints is : [{“y”:1,”x”:”model3″},{“y”:1,”x”:”model4″},{“y”:1,”x”:”model1″},{“y”:1,”x”:”model2″}];

    What do you think could be the problem?

    #22158

    @samgonzul,

    X-Value can be numeric or date-time. But in the dataPoints that you are passing x-values are string. Changing ‘x’ to label, i.e. [{"y":1,"label":"model3"},{"y":1,"label":"model4″},{"y":1,"label":"model1"},{"y":1,"label":"model2"}] should work fine.


    Vishwas R
    Team CanvasJS

    #22163

    Thank you very much this works perfect!

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

You must be logged in to reply to this topic.