加载AmCharts时出现问题:找不到ERR文件

时间:2017-04-08 12:28:12

标签: javascript svg google-chrome-extension amcharts

我正在使用AmCharts制作Chrome扩展程序。 图表无法加载,我收到以下错误。

  

imglens.svg:1 GET chrome-extension://cdjjnkkllgppipkdeobjempdfnafkjcm/charts/imglens.svg net :: ERR_FILE_NOT_FOUND

     

imgdragIconRoundBig.svg:1 GET chrome-extension://cdjjnkkllgppipkdeobjempdfnafkjcm/charts/imgdragIconRoundBig.svg net :: ERR_FILE_NOT_FOUND

但是我查看了AmCharts文件夹。没有这样的文件。 我该怎么办?

代码段

var chart = AmCharts.makeChart( "chartdiv", {
"type": "serial",
"valueAxes": [ {
"position": "left"
} ],
"graphs": [ {
"id": "g1",
"balloonText": "Open:<b>[[open]]</b><br>Low:<b>[[low]]</b><br>High:<b>[[high]]</b><br>Close:<b>[[close]]</b><br>",
"proCandlesticks": pro,
"closeField": "close",
"fillColors": "#117e1a",
"highField": "high",
"lineColor": "#117e1a",
"lineAlpha": 1,
"lowField": "low",
"fillAlphas": 0.9,
"negativeFillColors": "#7b1111",
"negativeLineColor": "#7b1111",
"openField": "open",
"title": "Price:",
"type": "candlestick",
"valueField": "close"
} ],

"chartScrollbar": {
"graph": "g1",
"graphType": "line",
"scrollbarHeight": 30
},
"chartCursor": {
"valueLineEnabled": true,
"valueLineBalloonEnabled": true
},
"categoryField": "date",
"categoryAxis": {
"parseDates": true
},
  "dataProvider": data,/*
   "responsive": {
"enabled": true
},*/
"pathToImages": "/charts/img"
},2000);

1 个答案:

答案 0 :(得分:0)

尝试重新下载amcharts zip文件。所有这些文件都存在于amcharts/images/文件夹中。 pathToImages需要指向存储图表图标和图像的文件夹,如果您将这些文件移动到其他文件夹(默认情况下它在图像文件夹中查找)。如果您使用不同的路径(即/charts/img/

,您也需要使用尾部斜杠

images folder contents