我正在使用JqPlot。Jqplot - 高亮顯示工具提示多軸y的數據
這是我fiddle以下是我的截圖。我正在使用兩個y軸。在左邊的y軸上我有我的收入,在我的右邊我有我的頁面瀏覽量。
現在上線徘徊,我想同時顯示在工具提示中觀和收入,如例子中看到下面我只能夠一次獲得來自2個軸的數據。
有什麼想法?
下面是我的代碼
$(document).ready(function() {
$.jqplot.config.enablePlugins = true;
s1 = [['23-May-08',1, 11],['24-May-08',4, 14],['25-May-08',2, 22],['26-May-08', 6, 26]];
s2 = [['23-May-08',11, 1],['24-May-08',14, 4],['25-May-08',22, 2],['26-May-08', 26, 6]];
plot1 = $.jqplot('chart',[s1, s2],{
title: 'Highlighting, Dragging, Cursor and Trend Line',
axes: {
xaxis: {
renderer: $.jqplot.DateAxisRenderer,
tickOptions: {
formatString: '%#m/%#d/%y'
},
numberTicks: 4
},
yaxis: {
tickOptions: {
formatString: '$%.2f'
}
}
},
highlighter: {
show:true,
},
cursor: {
show: true
},
series: [
{
lineWidth: 2,
highlighter: { formatString: "<div style='background-color:white; border:1px #ddd solid; width:220px; height:60px'>%s . Views : %s Revenue : %s </div>" }
},
{
yaxis: 'y2axis',
highlighter: { formatString: "<div style='background-color:white; border:1px #ddd solid; width:220px; height:60px'>%s . Views : %s Revenue : %s </div>" }
}]
});
});
您可以從yaxes2如果你想=>'y2axis格式化或隱藏網格:{tickOptions:{showGridline:假}}' – sdespont