在 dc.js 中隐藏 header 行

Hiding header row in dc.js

我正在按照本教程学习 D3v3

http://bl.ocks.org/d3noob/6077996

    .dimension(timeDimension)
    .group(function(d) { return "List of all earthquakes corresponding to the filters"
     })
    .size(10)                           // number of rows to return
    .columns([
      function(d) { return d.dtg; },
      function(d) { return d.lat; },
      function(d) { return d.long; },
      function(d) { return '<a href=\"http://maps.google.com/maps?z=11&t=m&q=loc:' + d.lat + '+' + d.long +"\" target=\"_blank\">Google Map</a>"},
      function(d) { return '<a href=\"http://www.openstreetmap.org/?mlat=' + d.lat + '&mlon=' + d.long +'&zoom=11'+ "\" target=\"_blank\"> OSM Map</a>"}
    ])
    .sortBy(function(d){ return d.dtg; })
    .order(d3.ascending);

我正在尝试删除这部分 "List of all earthquakes corresponding to the filters" 作为 table 中的第一行。但是,我尝试了很多解决方案,例如删除 group,它只会使 table 无法使用。谁有解决办法?

谢谢!我对 D3 非常陌生,只是在尝试!

您可以使用

dataTable
    .showGroups(false)

隐藏分组行 (documentation)。

不幸的是,目前没有办法阻止 dc.js 对数据 table 进行分组,但是如果 .group() 函数 returns 是一个常量值,那么你最终会与一组。

请勿将此 .group() 函数与其他图表上的函数混淆。 It's completely different.