【问题标题】:How do I make Title display above the horizon chart instead of below in cubism.js?如何在 cubism.js 中使标题显示在地平线图上方而不是下方?
【发布时间】:2012-10-18 21:32:56
【问题描述】:

我正在使用 .alias,但是当渲染水平线图时,它会在图表的右下方显示标题:Chart Foo。如何让标题显示在图表上方?

        // Create metrics
        var metrics = [
          graphite.metric("foo.bar").alias("Chart " + "Foo"),
          graphite.metric("baz.qux").alias("Chart " + "Baz")
        ];

        d3.select(".span9").call(function(div) {
          div.select(".new").call(context.axis().orient("top"));
          div.select(".new").selectAll(".horizon")
           .data(metrics)
           .enter().append("div")
           .attr("class", "charts")
           .call(context.horizon().height(100));
        });

【问题讨论】:

    标签: cubism.js


    【解决方案1】:

    您想修改 .horizon .title 的 css。

    例如

    .horizon .title {
        bottom: 90;
        margin: 0px 6px;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-23
      • 2013-03-12
      • 2021-09-15
      • 2016-06-16
      • 2012-11-19
      • 1970-01-01
      • 2019-07-31
      • 1970-01-01
      相关资源
      最近更新 更多