javascript - 如何在 c3.js 时间序列图表下方填充

标签 javascript charts pubnub c3.js

如何在 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]

        ] };
    }
});

enter image description here

最佳答案

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有关此的更多详细信息。

关于javascript - 如何在 c3.js 时间序列图表下方填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33095987/

相关文章:

javascript - 将文本区域中的文本限制为元素的实际区域

javascript - jquery 使用 AND 和 OR 运算符按属性选择第 2 部分

javascript - 为什么nestjs拦截器返回未定义?

javascript - 自定义 React Native Chart Kit 的颜色

java - 图表,服务器端还是客户端?

android - 根据UUID退订用户

javascript - jQuery 的 ENTER 事件

c++ - 用 C++ 制作图表

android - React Native Android 远程推送通知未显示

iphone - 如何知道 Pubnub 中的退订 channel 请求是否成功?