score:4
Accepted answer
From HighCharts:
It is not possible to use the jQuery .getJSON() function on JSON files outside of your own domain. It is however possible to use JSONP.
You need to add a callback to your PHP, which wraps the JSON and then you return that JSON object:
Example:
<?php
header("content-type: application/json");
$array = array(7,4,2,8,4,1,9,3,2,16,7,12);
echo $_GET['callback']. '('. json_encode($array) . ')';
?>
With those changes you can use use jQuery's $.getJSON() like so:
var url = "http://url-to-your-remote-server/jsonp.php?callback=?";
$.getJSON(url, function(data) {
var yourJSONP = data;
// render you chart here
});
Here are the relevant docs for Cross Domain Data:
http://www.highcharts.com/docs/working-with-data/getting-data-across-domains-jsonp
Source: stackoverflow.com
Related Query
- "TypeError: c.slice is not a function" when trying to call a function within JQuery
- Highcharts saying undefined is not a function when trying to add a new chart
- Code works on fiddle but not when I do /show
- Uncaught TypeError: undefined is not a function when using highcharts
- using angular directive to draw highchart pie chart but when i am using it in success function it is not working
- Customise Highcharts Pie Chart Selection State so that slice does not animate out when selected
- Maximum call stack size exceeded when trying to access highcharts via selenium
- Call a function from within highchart click event in reactjs
- When trying to display a chart using ChartIt, Error saying template does not exist arises
- x-axis, y-axis lines does not appear, when I include 3D chart library of HighChart in my code
- ajax call does not fire jquery code
- TypeError: B is not a function when exporting
- Use of highcharts' addChart function within a getJSON call (looping over multiple local files)
- How can I fix the error #17 "The requested series type does not exist" error when trying to display a highcharts graph in Vue.js?
- The chartoptions in highcharts are not getting updated from function call in ngoninit
- Highmaps call JavaScript function when region is clicked
- xAxis event do not call the callback function
- Trying to get Gridster to call functions like disable but $('.gridster ul').gridster().data('gridster'); not working
- TypeError: undefined is not a function when using highchart
- jQuery dialog error when opening dialog second time - TypeError: oa is not a function
- Highcharts :Uncaught TypeError: $(...).highcharts is not a function
- How to get rid of Function calls are not supported in decorators in Angular aot compiling?
- Resolve Conflict When Using Highchart and Highmap together (TypeError: ma is not a function)
- Highcharts area fillOpacity do not work when changing the color
- TypeError: $(...).highcharts is not a function
- Call an angular component method when we click on highchart series
- Uncaught TypeError: e.doDrilldown is not a function - Highcharts
- Uncaught TypeError: undefined is not a function - Highcharts - MVC
- Highcharts.stockChart is not a function
- HighCharts TypeError: ha is not a function
More Query from same tag
- Highcharts: browser width affects marker drawn or hidden
- highstock, how to prevent chart rescaling
- How to get the series' x-axis values into the lower part of the tooltip in Highcharts?
- What do the totals do in a highcharts rose chart?
- Incorrectly displayed plot band icon in Highcharts
- highcharts and canvg scaling issue
- Mootools Highcharts radio button toggle between charts, working jQuery version
- Proper way to remove all series data from a highcharts chart?
- Highcharts columns overlapped
- Make single bar in highcharts the width of the container
- negative values in highcharts stacked column chart
- highcharts - setting step on axis dynamically
- Highchart range selector doesn't show up
- How to add another same chart but with different data?
- How can add borderColor and borderWidth to Column type - highchart?
- Indicate an important date on a chart with either a guideline (with text) or an opened callout
- Highchart json from mysql data not able to show up in line graph
- Is it possible to show text on top of an Arearange chart
- Highcharts hover delay and not rendering with multiple series
- Highchart-ng not displaying inside a directive
- Timeline / Schedule in highcharts
- Angular-Highcharts: Chart Pie is not working when change between tabs
- Highchart Semi Circle With Gauge Chart. Shrink pie chart and move gauge up
- HighCharts column to pie
- Error using Highcharts (>= 8.0.1) function stockChart() in Angular
- Can we Fixed High charts graph portion height irrespective of number of series or legends?
- Highcharts Map bubble on Pacific Centered World map
- Change background color of highcharts on hover
- How to make highchart points redirect to another component with value in React?
- How to make Highstock rangeselector buttons load new data?