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
- Highstock works vary slow when data sorted by string
- Highcharts value relative to itself instead of all lines
- how to create a world map using highmaps and disable part of legend?
- How to edit the html of a highchart label?
- ScatterPlot Point Click Event Not Working
- how to dynamically change chart type in highstock stock chart?
- How to convert a JavaScript object to array
- How to add a second tooltip to highcharts
- Tooltip outside working in highcharts but not in highstock
- Blank Datas in highcharts using Codeigniter and highcharts
- Removing Extended Wrap Method From Highcharts.wrap
- keeping highcharts stacked columns borderWdith but removing stacking gap
- Unable to get value of the property '0': object is null or undefined in IE7
- How to draw connectors for venn diagram chart in Highcharts?
- Highcharts bad rendering with slightly big numbers
- Highcharts data from MySQL / PHP
- ignoreHiddenSeries is not hiding values on X-axis if displayed series have null data
- Highstock Angular value in legend
- Kendo Linear Guage with logarithmic scale
- (Highcharts) Display Newest Data From Text File Only
- Highcharts not displaying chart from csv file
- highcharts: dynamically define colors in pie chart
- Highcharts gauge not shown
- How to format xAxis label as date for each value in Highcharts?
- Highcharts: Negative values of the secondary axis should come below the x axis
- Real Time Bar chart using Highcharts and AngularJs
- Is this graph possible to do using Highchart?
- Draw symbols between bars in highcharts
- Hover style for labels in legend
- Highchart - Min max and Mean chart