Home Forums StockChart Support stockcharts addTo “data”

stockcharts addTo “data”

Viewing 3 posts - 1 through 3 (of 3 total)
  • #41994
    	document.getElementById("submitup").addEventListener("click", function()
    	{
    		stockChartA.addTo("data", {
    			type: "line", 
    			axisYType: "secondary",
    			markerType: "none",
    			lineDashType: "solid",
    			color:"red",
    			lineThickness: 1,
    			toolTipContent: null,
    			//markerSize: 1,
    			dataPoints: [
    				{ x: 1000, y: 970, markerType: "circle" },
    				{ x: 1050, y: 970 }
    			]
    		});
    	});

    Why the code above works on “chart” and when used in “stockchart” writes: “Property “data” doesn’t exist. Please check for typo.” ?

    #41996

    @mcigorli,

    data is an element of chart and not stockchart. Passing it in chart should work fine in your case. Kindly take a look at the code-snippet below,

    stockChartA.charts[0].addTo("data", {
    	type: "line", 
    	axisYType: "secondary",
    	markerType: "none",
    	lineDashType: "solid",
    	color:"red",
    	lineThickness: 1,
    	toolTipContent: null,
    	//markerSize: 1,
    	dataPoints: [
    	    { x: 1000, y: 970, markerType: "circle" },
    	    { x: 1050, y: 970 }
            ]
    });

    If you are still facing issue, can you kindly create JSFiddle reproducing the issue you are facing & share it with us so that we can look into the code / chart-options being used, understand the scenario better and help you resolve?


    Adithya Menon
    Team CanvasJS

    #42038

    Good job!

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

You must be logged in to reply to this topic.