flot jquery is it possible to draw this kind of chart

这一生的挚爱 提交于 2019-12-18 07:19:50

问题


I used to draw this kind of chart (one vertical axis, one horizantal axis):

Now i have been asked to do this kind of chart:

as you see, the problem with the ordered chart that it contains (two vertical axis, one horizantal axis).

My question

does flot or any other jquery library able to do that please?


回答1:


See the flot example here on multiple axis. Minimal example:

$.plot("#placeholder", [
    { data: d1 },
    { data: d2, yaxis: 2 } // set second series to use second axis
], {
    yaxes: [ { 
            min: 0 // options for first axis
        }, {
            alignTicksWithAxis: 1 // options for second axis, put it on right
            position: "right"
        } ],
});

Two mix a bar and line chart set that in each's series object:

    $.plot("#placeholder", [{
        data: d1,
        lines: { show: true }
    }, {
        data: d2,
        bars: { show: true }
    }]);

Putting these together, here's an example:



来源:https://stackoverflow.com/questions/25349545/flot-jquery-is-it-possible-to-draw-this-kind-of-chart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!