无法在 SAPUI5 中实现 AmCharts Gauge 类型
Not able to implement AmCharts Gauge type in SAPUI5
我正在尝试在我的 UI5 应用程序中添加仪表图表。我能够成功地使用 "Series" 类型实现图表。所以我可以从 manifest.json 文件加载库。但是当我尝试实施仪表图时。我收到下面提到的错误。
amcharts.js? eval:174 未捕获类型错误:d.AmAngularGauge 不是构造函数
我正在使用此代码:
var gaugeChart = AmCharts.makeChart( "chartdiv", {
"type": "gauge",
"theme": "light",
"axes": [ {
"axisThickness": 1,
"axisAlpha": 0.2,
"tickAlpha": 0.2,
"valueInterval": 20,
"bands": [ {
"color": "#84b761",
"endValue": 90,
"startValue": 0
}, {
"color": "#fdd400",
"endValue": 130,
"startValue": 90
}, {
"color": "#cc4748",
"endValue": 220,
"innerRadius": "95%",
"startValue": 130
} ],
"bottomText": "0 km/h",
"bottomTextYOffset": -20,
"endValue": 220
} ],
"arrows": [ {} ],
"export": {
"enabled": true
}
} );
在我的视图中,我正在 VBox 中渲染地图。
此致,
女士
您不是在代码中实现系列图表,而是在实现仪表图表。该错误告诉您您没有包含 gauge.js 文件。 amcharts.js 是不够的,因为它是基础库并且 serial.js 不包含仪表图 类。确保您的规格表包含以下内容:
<script type="text/javascript" src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script type="text/javascript" src="https://www.amcharts.com/lib/3/gauge.js"></script>
<!-- if you need other charts like pie, radar, and series include those js files -->
<!-- plugins such as export and dataloader also come after the chart includes -->
您可以通过查看 AmCharts 的 demos page.
了解每种类型需要包含哪些图表库
我正在尝试在我的 UI5 应用程序中添加仪表图表。我能够成功地使用 "Series" 类型实现图表。所以我可以从 manifest.json 文件加载库。但是当我尝试实施仪表图时。我收到下面提到的错误。
amcharts.js? eval:174 未捕获类型错误:d.AmAngularGauge 不是构造函数
我正在使用此代码:
var gaugeChart = AmCharts.makeChart( "chartdiv", {
"type": "gauge",
"theme": "light",
"axes": [ {
"axisThickness": 1,
"axisAlpha": 0.2,
"tickAlpha": 0.2,
"valueInterval": 20,
"bands": [ {
"color": "#84b761",
"endValue": 90,
"startValue": 0
}, {
"color": "#fdd400",
"endValue": 130,
"startValue": 90
}, {
"color": "#cc4748",
"endValue": 220,
"innerRadius": "95%",
"startValue": 130
} ],
"bottomText": "0 km/h",
"bottomTextYOffset": -20,
"endValue": 220
} ],
"arrows": [ {} ],
"export": {
"enabled": true
}
} );
在我的视图中,我正在 VBox 中渲染地图。
此致, 女士
您不是在代码中实现系列图表,而是在实现仪表图表。该错误告诉您您没有包含 gauge.js 文件。 amcharts.js 是不够的,因为它是基础库并且 serial.js 不包含仪表图 类。确保您的规格表包含以下内容:
<script type="text/javascript" src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script type="text/javascript" src="https://www.amcharts.com/lib/3/gauge.js"></script>
<!-- if you need other charts like pie, radar, and series include those js files -->
<!-- plugins such as export and dataloader also come after the chart includes -->
您可以通过查看 AmCharts 的 demos page.
了解每种类型需要包含哪些图表库