I am trying to display a chart using TypeScript/Angular, using the following:
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
zoomEnabled: true,
title:{
text: "Parity",
fontFamily: "Roboto",
fontSize: 36,
},
axisX: {
title:"X Axis",
titleFontSize: 20,
},
axisY:{
title: "Y Axis",
titleFontSize: 20,
},
data: [{
type: "scatter",
toolTipContent: "<b>X: </b>{x}<br/><b>Y: </b>{y}",
dataPoints: [
{ x: 800, y: 350 },
{ x: 900, y: 450 },
{ x: 850, y: 450 },
{ x: 1250, y: 700 },
{ x: 1100, y: 650 }
]
}]
});
After I build, the first line in the above code gets converted to this:
var chart = new undefined("chartContainer", {
How can I prevent CanvasJS.Chart from being converted to undefined? I am already importing the canvasjs.min file