代码之家  ›  专栏  ›  技术社区  ›  diogenes

标题左对齐

  •  0
  • diogenes  · 技术社区  · 7 年前

    我刚接触过c3(和d3),一直在使用zingcharts。

    我想将图表标题移到左边缘。

    我已经尝试过CSS,但没有任何移动。我可以更改大小和颜色,但不能更改对齐方式或位置。

    .c3标题{
    字体大小:26px;
    填充:绿色;
    文本对齐:左对齐;
    }
    < /代码> 
    
    

    以及用于添加标题的c3。

    标题:{
    text:'我的标题',
    }
    < /代码> 
    
    

    谢谢。

    .c3-title {
      font-size: 26px;
      fill: green;
      text-align: left;
      }
    

    以及添加标题的c3。

    title: {
             text: 'My Title',
     },
    

    enter image description here

    谢谢您。

    1 回复  |  直到 7 年前
        1
  •  1
  •   mgraham    7 年前

    1. title: { text:"TITLE", position: "upper-left"},

    http://jsfiddle.net/cbd3fs41/

    onrendered : function () {
        d3.select(this.config.bindto).select(".c3-title").attr("x", 50);
    }
    
    推荐文章