Jugal | Vertical Plot lines on x axis | Highchart & Highstock
http://stackoverflow.com/questions/10398192/change-highstock-flag-to-lines-on-xaxis
Jugal Thakkar
http://jugal.me/
by Yonathan Benitah
HTML
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js" ></script>
<script type="text/javascript" src="http://code.jugal.me/js/jugalsLib.js" ></script>
<script type="text/javascript" src="http://code.highcharts.com/stock/highstock.src.js" ></script>
<script type="text/javascript" src="http://code.highcharts.com/stock/modules/exporting.src.js" ></script>
<div id="container"></div>
CSS
#container{
min-width:500px;
}
JavaScript
var randomSeries=jugalsLib.createSeries();
var length=randomSeries.data.length;
var markerPosition=randomSeries.data[Math.floor(length*4/5)][0];
var chartingOptions = {
series:[randomSeries],
xAxis: {
plotLines: [{
value: markerPosition,
width: 1,
color: 'green',
label: {
useHTML: true,
text: '<b>My Marker</b>',
}}]
}
};
chartingOptions = $.extend({}, jugalsLib.getBasicChartOptions(), chartingOptions);
var chart = new Highcharts.StockChart(chartingOptions);