横坐标为日期:
$(function () { var $report = $('#report'); $('#container').highcharts({ chart: { }, xAxis: { plotLines: [{ // mark the weekend color: 'red', width: 2, value: Date.UTC(2010, 0, 4), dashStyle: 'longdashdot' },{ // mark the weekend color: 'red', width: 2, value: Date.UTC(2010, 0, 6), dashStyle: 'longdashdot' }], tickInterval: 24 * 3600 * 1000, // one day type: 'datetime' }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4], pointStart: Date.UTC(2010, 0, 1), pointInterval: 24 * 3600 * 1000}] }); });
横坐标为数字:
$(function () { var $report = $('#report'); $('#container').highcharts({ chart: { }, xAxis: { allowDecimals: false }, plotOptions: { series: { pointStart: 100 } }, xAxis: { plotLines: [{ // mark the weekend color: 'red', width: 2, value:102, dashStyle: 'ShortDash' },{ // mark the weekend color: 'red', width: 2, value: 103, dashStyle: 'ShortDash' }] }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4] }] }); });