【问题标题】:Is there a way to change the type of the subcharts in c3.js有没有办法改变 c3.js 中子图的类型
【发布时间】:2016-03-08 15:32:09
【问题描述】:

我制作了一个条形图,它还有一个子图。我想将子图的类型更改为线。如,主图应该是条形图,而子图应该是折线图。

这是我用来生成图表的一段代码。但是子图的类型不起作用。

var chart=c3.generate({
        bindto:bindTo(),
        data:{ 
            x:'x',
            /* value:['Percent DEP Enabled'],*/
            columns:data(),            
        type: 'bar'     
        },
        subchart: {
            show: true,
            size: {
            height: 25
            },

            },
        axis: {
                 x: {
                      type: 'timeseries',
                      tick: {
                      format: '%m-%d-%y',
                        rotate: -45,
                      },
                      height: 75
                  },/* y: {
                      tick: {
                          values: function(){
                                        jQuery.forEach(function(){

                                        })}
                          count: 8,
                          format:d3.format(".2s"),
                      },
        },*/
        subchart: {
            show: true,
            type: 'line',
            }
        }
        });

【问题讨论】:

    标签: javascript jquery d3.js charts c3.js


    【解决方案1】:

    您不能这样做,因为没有像 axis.subchart 这样的设置。当您查看reference 时,您会找到所需的一切,但在您的情况下,没有选择。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多