D3.js dc.js不显示y轴

D3.js dc.js不显示y轴,d3.js,dc.js,crossfilter,D3.js,Dc.js,Crossfilter,我有一组数据,我想呈现在频率的折线图上 数据解析 var volumeChart = dc.barChart('#monthly-volume-chart'); var dateFormatSpecifier = '%Y-%m-%dT%H:%M:%S.000Z'; var dateFormat = d3.timeFormat(dateFormatSpecifier); var dateFormatParser = d3.timeParse(dateFormatSpecifier)

我有一组数据,我想呈现在频率的折线图上

数据解析

var volumeChart = dc.barChart('#monthly-volume-chart');
var dateFormatSpecifier = '%Y-%m-%dT%H:%M:%S.000Z';
    var dateFormat = d3.timeFormat(dateFormatSpecifier);
    var dateFormatParser = d3.timeParse(dateFormatSpecifier);
    var numberFormat = d3.format('.2f');

    data.forEach(function (d) {
        d.dd = dateFormatParser(d.timestamp);
        d.minute = d3.timeMinute(d.dd)
        //coerce to number with a +
    });
维度分组

var freqByMins = ndx.dimension(function (d) {
    return d.minute;
});
var aa = freqByMins.group()
console.log(aa.all())
var freqByMinsGroup = aa.reduceCount(function (d) {
    return d.minute;
});
console.log(freqByMinsGroup.all())
查看
freqByMinsGroup.all()
我得到以下数据

0: {key: Thu Feb 21 2019 05:29:00 GMT+0800 (Singapore Standard Time), value: 2}
1: {key: Thu Feb 21 2019 05:30:00 GMT+0800 (Singapore Standard Time), value: 5}
2: {key: Thu Feb 21 2019 05:31:00 GMT+0800 (Singapore Standard Time), value: 6}
3: {key: Thu Feb 21 2019 05:32:00 GMT+0800 (Singapore Standard Time), value: 3}
4: {key: Thu Feb 21 2019 05:33:00 GMT+0800 (Singapore Standard Time), value: 1}
5: {key: Thu Feb 21 2019 05:34:00 GMT+0800 (Singapore Standard Time), value: 1}
6: {key: Thu Feb 21 2019 05:35:00 GMT+0800 (Singapore Standard Time), value: 3}
7: {key: Thu Feb 21 2019 05:36:00 GMT+0800 (Singapore Standard Time), value: 4}
8: {key: Thu Feb 21 2019 05:38:00 GMT+0800 (Singapore Standard Time), value: 4}
9: {key: Thu Feb 21 2019 05:39:00 GMT+0800 (Singapore Standard Time), value: 7}
length: 10
渲染图

 volumeChart.width(960)
    .height(100)
    .margins({top: 10, right: 10, bottom: 20, left: 40})
    .dimension(freqByMins)
    .group(freqByMinsGroup)
    .transitionDuration(500)
    .elasticY(true)

    .x(d3.scaleTime().domain([new Date(2019, 2, 21, 5, 29, 0), new Date(2019, 2, 21, 5, 40, 0)]))
    .xAxis();
但是,我的交叉过滤器图表不呈现任何y轴

附件是一张图片


对于任何可能看到这个问题的人

错误出现在html中

<div class="row">
    <div id="monthly-move-chart">
        <strong>Monthly Index Abs Move & Volume/500,000 Chart</strong>
        <span class="reset" style="display: none;">range: <span class="filter"></span></span>
        <a class="reset" href="javascript:moveChart.filterAll();volumeChart.filterAll();dc.redrawAll();"
           style="display: none;">reset</a>

        <div class="clearfix"></div>
    </div>
</div>

月度指数Abs移动和交易量/500000图表
范围:
当我使用另一个索引时

<div id="quarter-chart">
        <strong>Quarters</strong>
        <a class="reset" href="javascript:quarterChart.filterAll();dc.redrawAll();" style="display: none;">reset</a>

        <div class="clearfix"></div>
    </div>

季度

成功了。我猜这是因为它依赖于另一个图表。当我没有再次真正检查html时,我真的在胡乱修改示例,可能会导致一些有趣的错误,但仍然没有足够的信息来重现问题。当我在另一个问题中将你的代码放在小提琴上时,它显示了Y轴。你能试试分叉和添加你的代码吗?@Gordon,我已经解决了。这是我在html方面的一个错误。我在下面的答案中作了更正。谢谢你的帮助。我无法使用JSFIDLE,因为我似乎无法在itAwesome中找到dc.js,感谢您的关注。我猜是一些错误的CSS,因为我也看不出问题所在。@Gordon这与dc.datatables.js中的ur stock.js的示例相同。我在胡闹。我没有改变任何css。你的演示也有同样的问题,所以我假设它是预期的行为?啊,它故意隐藏在CSS中,因为这使它在用作范围图时看起来更好。