日期:2014-05-16 浏览次数:20375 次
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Highstock Example</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <script type="text/javascript"> $(function() { $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?', function(data) { document.getElementById("h").value=data; // Create the chart window.chart = new Highcharts.StockChart({ chart : { renderTo : 'container' }, rangeSelector : { selected : 1 }, title : { text : '图表分析' }, yAxis : { title : { text : 'Exchange rate' }, max:1, min:0, plotLines : [{ value : 0.2, color : 'green', dashStyle : 'shortdash', width : 2, label : { text : '下限(0.2)' } }, { value : 0.7, color : 'red', dashStyle : 'shortdash', width : 2, label : { text : '上限(0.6)' } }] }, series : [{ name : 'USD to EUR', data : data, tooltip : { yDecimals : 4 } }] }); }); }); </script> </head> <body> <script type="text/javascript" src="../../js/highstock.src.js"></script> <div id="container" style="height: 500px; min-width: 500px"></div> <input type="text" name="h" id="h" value=""> </body> </html>