flot jquery is it possible to draw this kind of chart

前端 未结 1 1689
时光取名叫无心
时光取名叫无心 2020-12-20 07:51

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

\"enter

相关标签:
1条回答
  • 2020-12-20 08:07

    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:

    enter image description here

    0 讨论(0)
提交回复
热议问题