【问题标题】:How to get a fill below c3.js timeseries chart如何在 c3.js 时间序列图表下方填充
【发布时间】:2015-10-14 02:24:09
【问题描述】:

如何在 c3.js 时间序列图表(如堆积面积图)下方填充,但 x 轴剩余时间序列的值。我正在使用 PUBNUB 的 EON 图表库,但它使用 c3.js 作为基础库。

eon.chart({
    pubnub   : pubnub,
    history  : false,
    channel  : 'orbit2',
    flow     : true,
    generate : {
        bindto : '#chart',
        size: {
        height: 240,
        width: 380
    },
        data   : {
            x      : 'x',
            labels : true
        },
        axis : {
            x : {
                type : 'timeseries',
                tick : {
                    format : '%H:%M:%S'
                },
                zoom: {
                   enabled: true
                }
            }
        }
    },
    transform : function(m) {
        return { columns : [
            ['x', new Date().getTime()],
            ['Bytes Written', m.Bytes_Written],
            ['Bytes Read', m.Bytes_Read]

        ] };
    }
});

【问题讨论】:

    标签: javascript charts pubnub c3.js


    【解决方案1】:

    PubNub EON 图表类型

    您只需要提供要使用的图表类型。 EON landing page and here is a code sample from one of the examples on that page上有一些样片:

    eon.chart({
      channel: channel,
      pubnub: pubnub,
      generate: {
        bindto: '#chart',
        data: {
          labels: true,
          type: 'bar'
        },
        bar: {
          width: {
            ratio: 0.5
          }
        },
        tooltip: {
            show: false
        }
      }
    });
    

    注意在generate EON 参数下配置的data 键。 See c3 docs/examples 了解更多详情。

    【讨论】:

      猜你喜欢
      • 2015-11-08
      • 1970-01-01
      • 2018-10-31
      • 1970-01-01
      • 2015-12-03
      • 2016-01-14
      • 1970-01-01
      • 2015-12-15
      • 2015-12-04
      相关资源
      最近更新 更多