【问题标题】:amCharts 5: Is is possible to rotate axes tick labels?amCharts 5:是否可以旋转轴刻度标签?
【发布时间】:2021-12-11 04:38:15
【问题描述】:

是否可以在 amCharts 5 中旋转轴刻度标签?例如

我在新的 amCharts 5 文档中的任何地方都找不到提到的这一点。这是possible in amCharts 4

【问题讨论】:

    标签: javascript amcharts amcharts5


    【解决方案1】:

    这可以通过在相关轴渲染器的labels.template 上设置rotation 属性来实现,例如:

    //...
    const xAxisRenderer = am5xy.AxisRendererX.new(root, {});
    
    xAxisRenderer.labels.template.setAll({
      rotation: -45,
    });
    
    const xAxis = chart.xAxes.push(
      am5xy.CategoryAxis.new(root, {
        renderer: xAxisRenderer ,
        categoryField: 'category-name-here',
      })
    );
    //...
    

    发现于: amCharts 5 demo

    【讨论】:

      猜你喜欢
      • 2015-05-04
      • 1970-01-01
      • 2020-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多