Flot中有一个系列的多轴

时间:2011-07-01 18:29:38

标签: jquery flot

是否可以在Flot中只有一个数据系列的两个轴?

由于

1 个答案:

答案 0 :(得分:1)

是:https://www.google.com/search?q=flot+multiple+axes

  1. Multiple axes - Flot Example

    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());
    });
    
  2. Tutorial: Flot – How to Create Charts with Multiple Axes