score:1
/*Ajax call to get the Chart data in JSON Format */
function getJsonChartData(str )
{
var http_request = new XMLHttpRequest();
http_request.open("GET", "drawChart.php?client_name="+str, true);
http_request.onreadystatechange = function() {
var done = 4, ok = 200;
if(http_request.readyState == done && http_request.status == ok) {
my_JSON_object = JSON.parse(http_request.responseText); // JS json Object to capture the returning json text
chart.showLoading(); // show loading image on chart
/***************** setting data to chart dynamically *************/
chart.series[1].setData(my_JSON_object[5]); //should be 5
chart.series[2].setData(my_JSON_object[4]);
chart.series[3].setData(my_JSON_object[1]);
chart.series[4].setData(my_JSON_object[0]);
chart.series[5].setData(my_JSON_object[2]);
chart.series[6].setData(my_JSON_object[3]);
chart.xAxis[0].setCategories(my_JSON_object[6]);
}
};
http_request.send(null);
}
I went through with your question , but didn't got what you really wanted , any way if you trying to load highchart data dynamically from a JS file best way is to do a ajax call and get the data as a JSON object , then set that data manually by referring highchart's chart object above example is what how I used it to set data , via a php file , hope this helps :)
score:1
You need to update the <h:inputHidden>
on the ajax request so that jQuery gets the updated value.
<a4j:commandButton ... render="chartvalue" />
Easier is to just pass it as an argument into oncomplete
:
<a4j:commandButton ... oncomplete="chartdata(#{dailyReportBean.json})" />
with
<script type="text/javascript">
function chartdata(data) {
console.log("Chart data already retrieved: " + data);
}
</script>
Source: stackoverflow.com
Related Query
- How can I take a backingbean GSON string to Highcharts
- how can I use rangeselector and navigation in highcharts in the given code
- How can I get access to a Highcharts chart through a DOM-Container?
- HighCharts - How can I turn off the points?
- How can I change the colors of my highcharts piechart?
- How can I hide series from a HighCharts legend?
- How can I hide a series from initially being displayed in Highcharts
- How can I force multiple y-axis in Highcharts to have a common zero
- How can I fix Highcharts error #13?
- Highcharts: How can I take X-axis value in tooltip?
- How can i hide all the Series in highcharts at a time
- How can I remove the white border from HighCharts pie chart?
- How to convert datetime string to UTC to plot points on Highcharts
- How to convert datetime string to UTC to plot points on Highcharts
- Highcharts solidgauge : How can I disable gradient fill?
- Highcharts - How can I remove starting and ending padding from area chart
- How can I delete all of the points from a highcharts series
- How can I force highcharts to show every x-axis label regardless of spacing constraints?
- How to output JSON in python so it can be used for Geckoboard's Highcharts plugin
- How can i change highcharts data values by selecting from a dropdown list
- How can i keep the color the same in highcharts
- How can i force Highcharts to use same symbols in Legend and Series?
- Highcharts - How can I decrease space between categories?
- How to populate a Highcharts axis with string formatted data from a PHP array
- How can I force ticks/grid lines on a Highcharts datetime X axis to arbitrarily line up with data points?
- How can I hide and show a category in highcharts
- Highcharts : How can i move the tooltip to external DIV?
- How can I get around "mixed active content" highcharts exporting error?
- How Can I Hide a Pie Chart's Slice in HighCharts Without Removing It From the Legend?
- How can I make a graph with highcharts from csv file?
More Query from same tag
- Pie Chart is not coming with dynamic data in HIghChart
- Highcharts: annotation on y-axis
- Is it possible create a Highstock chart using TWO PANES and MULTIPLE SERIES in a pane
- Real Time Bar chart using Highcharts and AngularJs
- Trouble finding the correct crs value for bubble map on custom highmaps GeoJSON file
- Event listener on HiCharts - android
- How to set tooltip to highcharts legends?
- No data to display in highcharts showing up with the data in Bubble Chart
- Highcharts - Categories and X,Y data
- Highcharts - Rotate pie chart aligning the clicked section to a fixed point (180°)
- Highcharts - How to force line chart to be visible above X Axis
- Highcharts : point.key is too long and make chart small
- How to access highstock zoom buttons via jquery?
- Changing Data for HighMaps JQuery to a local file
- Highchart tooltips formatter issue
- Highchart columnrange with scrollbar
- How to open new chart to the adjacent <div> on bar click in highchart
- Highcharts loading data and not plotting
- Highcharts: xAxis with vertical gridlines
- How to configure date in Grantt chart of (Highcharts) so it accept date in string without javascript date?
- Highcharts export all data in Stockchart
- Is it possible to maintain the fillcolor when the y-axis is reversed?
- ZoomRange Highstock works not correct?
- Highcharts.js not working inside slick slider
- marked point on spline chart bound to x and y axis
- How to show count of data in pie-chart in chartkick rails
- Highcharts Gantt - how to force data labels to always be above milestones?
- conflict between twitter-bootstrap and HighCharts plugin
- Disabling a slice for a Highcharts pie chart when creating the chart
- In highcharts's stacked bar chart, how can I remove the white space between different