Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should use parseFloat() to change string into number for Ask / High values. </p> <pre><code>data.push([ parseInt(jsonData[i].InserTime.substr(6)), parseFloat(jsonData[i].Ask), parseFloat(jsonData[i].High), parseFloat(jsonData[i].Low), parseFloat(jsonData[i].Bid)]); </code></pre> <p>Here's a full example:</p> <p>HTML:</p> <pre><code>&lt;div class="graphs"&gt; &lt;div id="chartEURUSDContainer" style="height: 331px; min-width: 611px"&gt;&lt;/div&gt; &lt;/div&gt; &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="http://code.highcharts.com/stock/highstock.js"&gt;&lt;/script&gt; &lt;script src="http://code.highcharts.com/stock/modules/exporting.js"&gt;&lt;/script&gt; </code></pre> <p>Javascript:</p> <pre><code> $(function () { var jsonData = [{ "LastModification": "04:18:45", "Symbol": "EURUSD", "Bid": "1.33132", "Ask": "1.33157", "High": "1.33336", "Low": "1.33007", "Direction": "0", "InserTime": "\/Date(1358760060933)\/" }, { "LastModification": "04:20:05", "Symbol": "EURUSD", "Bid": "1.33151", "Ask": "1.33174", "High": "1.33336", "Low": "1.33007", "Direction": "0", "InserTime": "\/Date(1358760140625)\/" }, { "LastModification": "04:21:25", "Symbol": "EURUSD", "Bid": "1.3312", "Ask": "1.33144", "High": "1.33336", "Low": "1.33007", "Direction": "1", "InserTime": "\/Date(1358760220731)\/" }, { "LastModification": "04:22:48", "Symbol": "EURUSD", "Bid": "1.33115", "Ask": "1.33141", "High": "1.33336", "Low": "1.33007", "Direction": "-1", "InserTime": "\/Date(1358760300387)\/" }, { "LastModification": "04:23:48", "Symbol": "EURUSD", "Bid": "1.33107", "Ask": "1.33132", "High": "1.33336", "Low": "1.33007", "Direction": "-1", "InserTime": "\/Date(1358760361033)\/" }, { "LastModification": "04:25:08", "Symbol": "EURUSD", "Bid": "1.33139", "Ask": "1.33164", "High": "1.33336", "Low": "1.33007", "Direction": "0", "InserTime": "\/Date(1358760440193)\/" }, { "LastModification": "04:26:28", "Symbol": "EURUSD", "Bid": "1.33202", "Ask": "1.33222", "High": "1.33336", "Low": "1.33007", "Direction": "1", "InserTime": "\/Date(1358760520037)\/" }, { "LastModification": "04:27:48", "Symbol": "EURUSD", "Bid": "1.33212", "Ask": "1.33238", "High": "1.33336", "Low": "1.33007", "Direction": "-1", "InserTime": "\/Date(1358760600163)\/" }] var data = []; fillData(); function fillData() { for (i = 0; i &lt; jsonData.length; i++) { data.push([ parseInt(jsonData[i].InserTime.substr(6)), parseFloat(jsonData[i].Ask), parseFloat(jsonData[i].High), parseFloat(jsonData[i].Low), parseFloat(jsonData[i].Bid)]); } CreateChart(); } function CreateChart() { // create the chart chart = new Highcharts.StockChart({ chart: { renderTo: 'chartEURUSDContainer', type: 'candlestick', marginRight: 10, }, rangeSelector: { enabled: false }, scrollbar: { enabled: false }, navigator: { enabled: false }, series: [{ type: 'candlestick', color: '#00FF00', name: 'Currency Rates', data: data, }] }); } }); </code></pre> <p><a href="http://jsfiddle.net/Jj3Ws/5/" rel="nofollow">Demo on JS Fiddle</a>.</p>
    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.
    1. VO
      singulars
      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