【问题标题】:D3: Cubism.js: Hiding Labels from Horizon ChartsD3:Cubism.js:从地平线图表中隐藏标签
【发布时间】:2013-08-20 18:42:43
【问题描述】:

有人知道如何从水平图表中隐藏价值标签吗?

代码很简单

d3.select("#graphs").selectAll(".horizon")
    .data(data)
    .enter().insert("div", ".bottom")
    .attr("class", "horizon")
    .call(context.horizon().height(25)
                           .colors(colors));

【问题讨论】:

    标签: cubism.js


    【解决方案1】:

    这可以通过定义如下函数来解决

    function empty_label() {
      return "";
    } 
    

    然后在这里使用它:

    d3.select("#..")
      .selectAll(".horizon")
      .data(data)
      .enter()
      .insert("div", ".bottom")
      .attr("class", "horizon")
      .call(context.horizon().format(empty_label()));
    

    【讨论】:

      猜你喜欢
      • 2012-06-10
      • 2021-01-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多