其实我在这里一无所知。如何发布这个问题。基本上我正在尝试在Angular 2上实现Amcharts。
这是我的代码
this.tmpchart = AmCharts.makeChart("chartdiv"+index, {
"type": "serial",
"theme": "light",
"addClassNames" : "true",
"marginTop":0,
"marginRight": 80,
"dataDateFormat": "YYYY-MM",
dataSets: [{
title: "Markers",
fieldMappings: this.arrFieldMappings,
dataProvider: chartData,
classNameField: "bulletClass",
categoryField: "year",
dataDateFormat: "YYYY-MM"}
],
panels: [{
showCategoryAxis: true,
title: "",
recalculateToPercents: "never",
addClassNames: true,
"percentHeight": 60,
stockGraphs: [{
id: "g0",
title: this.segVal,
//"balloonText": arrMarkersID[0][1] + "<br><b><span style='font-size:14px;'>[[value]]</span></b>",
"balloonText": "<b><span style='font-size:14px;'>[[value]]</span></b>",
valueField: "value0",
comparable: true,
compareField: "value0",
type: "smoothedLine",
classNameField: "bulletClass",
bullet: "round",
bulletSize: 6,
useDataSetColors: false,
compareGraph: {
addClassNames: true,
bullet: "round",
lineThickness: 2,
type: "smoothedLine",
classNameField: "bulletClass"
}
},
{
id: "g1",
title: "Population",
//"balloonText": arrMarkersID[0][1] + "<br><b><span style='font-size:14px;'>[[value]]</span></b>",
"balloonText": "<b><span style='font-size:14px;'>[[value]]</span></b>",
valueField: "value1",
comparable: true,
compareField: "value1",
type: "smoothedLine",
classNameField: "bulletClass",
bullet: "round",
bulletSize: 6,
useDataSetColors: false,
compareGraph: {
addClassNames: true,
bullet: "round",
lineThickness: 2,
type: "smoothedLine",
classNameField: "bulletClass"
}
}],
}],
chartScrollbarSettings: {
//graph: "g1"
enabled: false
},
chartCursorSettings: {
valueBalloonsEnabled: true,
fullWidth:true,
cursorAlpha:0.6
},
periodSelector: {
selectFromStart: false,
inputFieldsEnabled: false,
periods: [{
period: "MM",
count: 1,
label: "1 month"
},{
period: "MM",
count: 3,
label: "3 Month"
},{
period: "MM",
count: 6,
label: "6 Month"
},{
period: "YYYY",
count: 1,
label: "1 year"
},{
period: "Max",
label: "Max",
selected: true
}]
}
});
我导入了amcharts依赖项,如下所示:
import 'amcharts3';
import 'amcharts3/amcharts/serial';
import 'amcharts3/amcharts/themes/light';
import 'amstock3';
import 'amstock3/amcharts/amstock'
当我执行时,我经常遇到错误
EXCEPTION: this.checkTransform is not a function
即使我不确定它是Amcharts
相关问题还是Angular2
。