Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting data from XML to update Highchart using JQuery
    primarykey
    data
    text
    <p>I have used <code>Highcharts</code> to construct the <code>BoxPlot</code> <code>http://www.highcharts.com/</code>. The data for this Chart comes from the XML document with following structure</p> <pre><code>&lt;spex&gt; &lt;NAME&gt;A&lt;/NAME&gt; &lt;PPP&gt;0.997&lt;/PPP&gt; &lt;QQQ&gt;0.600&lt;/QQQ&gt; .......&lt;/spex&gt; </code></pre> <p>Now I have used <code>xml to json</code> jquery plugin to get the data array from the <code>xml</code> file. As per instruction <a href="http://www.fyneworks.com/jquery/xml-to-json/" rel="nofollow">here</a> I have used following code to convert the data <code>$.get('include/Yspark/spark.xml', function(xml){ var boxvalues = $.xml2json(xml);</code></p> <p>When I watch the array returned by <code>boxvlaues</code> using <code>firebug</code> I get following array</p> <pre><code>NAME ["A", "B", "C", 2 more...] PPP ["0.997", "0.450", "0.230", 2 more...] QQQ ["0.600", "0.441", "0.994", 2 more...] </code></pre> <p>However when I try go set this array in the chart data array, nothing gets displayed in the data section (main </p> <p>whisker plot) however the <code>NAME</code> on the x-axis gets clubbed to the first whisker like <code>[A,B,C,D]</code> instead of </p> <p>representing the four whiskers.</p> <p>Here is what I have done </p> <pre><code>`$.get('include/Yspark/spark.xml', function(xml){ var boxvalues = $.xml2json(xml); $(function () { $('#container').highcharts({ chart: { type: 'boxplot' }, title: { text: 'Highcharts Box Plot Example' }, legend: { enabled: false }, xAxis: { categories: [boxvalues.NAME], title: { text: 'Experiment No.' } }, yAxis: { title: { text: 'Observations' } }, series: [{ name: 'Observations', data: [boxvalues.PPP,boxvalues.QQQ,boxvalues.RRR,boxvalues.SSS,boxvalues.TTT], tooltip: { headerFormat: '&lt;em&gt;Experiment No {point.key}&lt;/em&gt;&lt;br/&gt;' } }, ] }); }); });` </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload