私はJqPlotを使用しています。
これが私のフィドルで、以下が私のスクリーンショットです。2 つの y 軸を使用しています。左の 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>" }
}]
});
});