Home Forums Chart Support Error Charts with multiple datasets and errors

Error Charts with multiple datasets and errors

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

    Hi,

    Currently, I’m facing an issue with creating error chart with multiple datasets. While providining multiple datasets everythign seems fine, but while adding errors to each of them, the chart looks like that:

    
    var chart = new CanvasJS.Chart("chartContainer", {
    	animationEnabled: true,
    	title:{
    		text: "Average Lifespan of a Machinery"
    	},
    	axisY:{
    		title: "Lifespan (in Years)"
    	},
    	toolTip: {
    		shared: true
    	},
    	data: [{
    		type: "column",
    		name: "Avg. Lifespan",
    		toolTipContent: "{label} <br> <b>{name}:</b> {y} years",
    		dataPoints: [
    			{ y: 14, label: "Washing Machine" },
    			{ y: 16, label: "Refrigerator" },
    			{ y: 12, label: "Water Heater" },
    			{ y: 35, label: "Boilers" },
    			{ y: 11, label: "Television" },
    			{ y: 18, label: "AC" },
    			{ y: 9, label: "Dishwasher" },
              
    		]
    	},
               {
    		type: "column",
    		name: "Avg. Lifespan",
    		toolTipContent: "{label} <br> <b>{name}:</b> {y} years",
    		dataPoints: [
    			{ y: 14, label: "Washing Machine" },
    			{ y: 16, label: "Refrigerator" },
    			{ y: 12, label: "Water Heater" },
    			{ y: 35, label: "Boilers" },
    			{ y: 11, label: "Television" },
    			{ y: 18, label: "AC" },
    			{ y: 9, label: "Dishwasher" },
              
    		]
    	},
    	{
    		type: "error",
    		name: "Variability ",
    		toolTipContent: "<b>{name}:</b> {y[0]} - {y[1]} years",
    		dataPoints: [
    			{ y: [13, 16], label:"Washing Machine" },
    			{ y: [14, 17], label:"Refrigerator" },
    			{ y: [9, 13], label:"Water Heater" },
    			{ y: [30, 36], label:"Boilers" },
    			{ y: [9, 12], label:"Television" },
    			{ y: [15, 20], label:"AC" },
    			{ y: [8, 10], label:"Dishwasher" }
    			
    		]
    	},
              {
    		type: "error",
    		name: "Variability ",
    		toolTipContent: "<b>{name}:</b> {y[0]} - {y[1]} years",
    		dataPoints: [
    			{ y: [13, 16], label:"Washing Machine" },
    			{ y: [14, 17], label:"Refrigerator" },
    			{ y: [9, 13], label:"Water Heater" },
    			{ y: [30, 36], label:"Boilers" },
    			{ y: [9, 12], label:"Television" },
    			{ y: [15, 20], label:"AC" },
    			{ y: [8, 10], label:"Dishwasher" }
    			
    		]
    	}]
    });
    chart.render();

    Screen of the bug

    Is there anything I can do about that ?

    #31345
    #31358

    @neverased,

    By default, Error series is linked to its previous series. To attach Error series to a specific series you need to use linkedDataSeriesIndex property. Please take a look at this JSFiddle for updated code.

    In case you are still facing the issue, kindly create a JSFiddle reproducing the issue instead of screenshot or code snippet and share it with us so that we can look into the code, understand it better and help you out?

    From what we have observed, sometimes things get delayed mostly when we are not able to reproduce the issue or not able to understand the exact requirements or the solution that we provide may not work properly due to the variation in chart-options being used by you and us.

    Having a JSFiddle helps us in figuring out the scenario better and help you out accordingly.

    ___________
    Indranil Deo
    Team CanvasJS

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

You must be logged in to reply to this topic.