【问题标题】:flot jquery is it possible to draw this kind of chartflot jquery 是否可以绘制这种图表
【发布时间】:2014-08-17 13:19:35
【问题描述】:

我以前画过这种图表(一根纵轴,一根横轴):

现在我被要求做这种图表:

如您所见,它包含的有序图表存在问题(两个垂直轴,一个水平轴)。

我的问题

flot 或任何其他 jquery 库能做到这一点吗?

【问题讨论】:

    标签: javascript jquery charts flot


    【解决方案1】:

    在multiple axis 上查看 flot 示例。最小的例子:

    $.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"
            } ],
    });
    

    两个在各自的系列对象中混合设置一个条形图和折线图:

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

    把这些放在一起,这是一个example:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-05
      • 2019-10-12
      • 2013-12-19
      • 2012-02-23
      相关资源
      最近更新 更多