开发者

Multiple axis with one series in Flot

Is it possible to have two axis with only one data series in Flot?

开发者_StackOverflow社区

Thanks


Yes: 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜