Problem with simple pie chart dataloader json file
-
Hi,
I am having trouble trying to get a simple pie chart to work using dataloader and a json file in my local wordpress LAMP setup on my raspberry pi 3.
The default pie chart worked fine.
Then, I added the dataloader in the resources field:
https://www.amcharts.com/lib/3/amcharts.js https://www.amcharts.com/lib/3/pie.js https://www.amcharts.com/lib/3/plugins/dataloader/dataloader.min.js
The HTML field I left as is:
<div id="$CHART$" style="width: 100%; height: 300px;"></div>
The javascript field I changed to:
var $CHART$ = AmCharts.makeChart( "$CHART$", { "type": "pie", "dataLoader": { "url": "test.json" } "valueField": "litres", "titleField": "country" } );
The test.json file is in the main wordpress folder (/var/www/html in my case, which is the same folder the ‘wp-login.php’ file is in) and can be loaded using the link https://192.168.2.45/test.json which results in:
[ { "country": "Lithuania", "litres": 501.9 }, { "country": "Czech Republic", "litres": 301.9 }, { "country": "Ireland", "litres": 201.1 }, { "country": "Germany", "litres": 165.8 }, { "country": "Australia", "litres": 139.9 }, { "country": "Austria", "litres": 128.3 }, { "country": "UK", "litres": 99 }, { "country": "Belgium", "litres": 60 }, { "country": "The Netherlands", "litres": 50 } ]
The result of the preview or a page implementing the shortcode for this charts results in a blank page. ??
I’ve tried a lot of things in the past two hours to get it to work but nothing is working.
Am I missing something here?
Thanks in advance, much appreciated. ??
Best regards,
Jonatan.
https://www.ads-software.com/plugins/amcharts-charts-and-maps/
- The topic ‘Problem with simple pie chart dataloader json file’ is closed to new replies.