是否可以在Flot中只有一个数据系列的两个轴?
由于
答案 0 :(得分:1)
是:https://www.google.com/search?q=flot+multiple+axes
function doPlot(position) {
$.plot($("#placeholder"),
[ { data: oilprices, label: "Oil price ($)" },
{ data: exchangerates, label: "USD/EUR exchange rate", yaxis: 2 }],
{
xaxes: [ { mode: 'time' } ],
yaxes: [ { min: 0 },
{
// align if we are to the right
alignTicksWithAxis: position == "right" ? 1 : null,
position: position,
tickFormatter: euroFormatter
} ],
legend: { position: 'sw' }
});
}
doPlot("right");
$("button").click(function () {
doPlot($(this).text());
});