score:2
executing javascript from a remote source is a bad idea as you can't trust it. however, if you must:
the function included in the json is a string therefore you need to evaluate it:
pie.datalabels.formatter = eval('('+pie.datalabels.formatter+')');
for each method of the object that needs to be converted.
however, as said at the start, there is almost certainly a solution that does not require you to fetch javascript in this way.
score:0
i've decided to only return series data for the pie highchart ... instead of the whole highchart configuration array ... plotoptions are now defined in javascript and not returned by a json_encoded php array ..
i'm not too sure why i was doing that but thanks for all the help with eval!
Source: stackoverflow.com
Related Query
- Passing a JavaScript function from JSON encoded PHP
- passing json values to highcharts from .net code behind
- passing formatting JavaScript code to HighCharts with JSON
- send javascript function in PHP to be formatted as JSON (highcharts)
- Returning MySQL table values from PHP script to Javascript function - Live Graphing
- Bars does not show up when loading JSON encoded data from PHP in Highcharts
- Passing data from PHP array to Highcharts chart with JSON
- Pass function to jquery from php
- Sending javascript function with JSON is possible?
- c# WPF Webbrowser with Highchart, Javascript from external source not working "An error has occurred in the script on this page"
- Highcharts multiple series json from php
- Passing data to highcharts from javascript array or variable
- Pass a textfield value from php to javascript
- Getting data from Postgres in JSON format in ROR into a Highcharts javascript
- How to send json to highcharts from php
- Issue with JSON data encoded from the server, not able to plot the chart
- Generating json data for StockChart from PHP
- Having trouble JSON encoded data from MySQL through Highcharts
- Passing data from Javascript MVC controller
- Set HighCharts data from JSON string with setData() function
- Passing Returned Data from a PHP Script into a Highcharts data[] block?
- Generate JSON From Mysql Using PHP
- highchart feed data from php json
- Assigning JSON value to a Variable that Resides Outside JavaScript Function
- On click, passing a variable from Javascript into Rails/Ruby
- Parsing JSON for use with Highcharts using jquery .parseJSON or JSON.parse: how to remove quotes from function calls for formatters?
- Passing Decimal string from php to jquery
- Plotting multiple series from JSON php import to Highcharts
- How to call Objective-C function from javascript in iOS
- Use django variable (array of elements from sqlite3 database) inside javascript embedded code
More Query from same tag
- Placing labels inside pie chart slices (Highchart)
- Links in pie charts for Highcharts.js
- How to highlight specific Point with Highcharts Js
- Highchart, is it possible to have a 'for loop' inside 'series' section?
- Highmaps in yii using geojson file
- How could you supply multiple series to a line chart in R shiny using highcharter package and without hardcoding the series?
- How can I combine highcharts with different but similar x-axis categories?
- Not able to show data labels of column in highchart , incorrect format is showing
- Issue in width of the chart
- Highcharts - Bar - Setting the X axis width and the chart area width to be constant
- Highcharts Timeline Renaming Series Labels
- Setting highcharts datalabels backgroundColor with the same color of its serie
- AngularJS one-way binding on custom directive
- Highchart speedometer take input from csv
- Highstock get color of Candle in grouped data series
- JSON format is not supported by highchart
- Is it possible to show text on top of an Arearange chart
- Render Highchart with dynamic ID in jQuery tooltip
- Highcharts: How to divide line graph when there's a gap in the x axis
- highchart Sankey chart nodes flow with image for insights
- JSON data not showing in highstock Candlestick chart using PHP & MYSQL
- Remove Highcharts chart Y axis labels when legend clicked
- Highcharts: Is it possible to display series with the same name in different columns?
- How to prevent my stacked series from being in reverse order?
- set color of grouped stacked column in highcharts
- Add background box to y-axis in highcharts
- highcharts date not displayed properly on x axis
- Highcharts gauge keep tooltip visible and centered
- Highcharts: Is it possible to style individual pie chart slices?
- Change the text of the back button on Highcharts Treemap?