如何更改y轴 - dc.js复合线图的范围

时间:2016-04-26 11:10:55

标签: dc.js crossfilter

一些信息: 我有一个复合线图。 我的问题是: 我使用elasticY但我的轴从0开始,但我的最小值可以是250。 有没有机会从250而不是从0开始Y轴?但动态Y轴应该起作用(elasticY)

    var compositeAvg = dc.compositeChart("#avgline-chart");

    compositeAvg.width(1500).height(375)
        .group(filtered_group)
        .brushOn(true)
        .yAxisLabel("Morbalwait AVG ")
        .x(d3.scale.ordinal()) //x axis
         .xUnits(dc.units.ordinal)
        .margins({ top: 10, left: 50, right: 10, bottom: 50 })
        .elasticY(true)
        .elasticX(true)
        ._rangeBandPadding(1)
        .compose(composeLines())
        .legend(dc.legend().x(1425).y(0).itemHeight(13).gap(1));    

1 个答案:

答案 0 :(得分:2)

你试过.y(d3.scale.linear()。domain([250,yourmaxvalue]))