【问题标题】:Amchart: Label Names in Vertical Axes Stack ChartsAmchart:垂直轴堆栈图中的标签名称
【发布时间】:2019-08-22 10:16:10
【问题描述】:

垂直堆栈轴图的代码已明确记录在here

所以我不会重写代码。

我试图将标签放入每个堆栈,如此屏幕截图所示,但无济于事。请帮忙。

【问题讨论】:

    标签: javascript html amcharts amcharts4


    【解决方案1】:

    您需要将标签添加到值轴renderer.gridContainer,设置它们的isMeasured = false,使其脱离布局流程并且不会干扰其他任何内容。您必须摆弄布局以使其居中,但这里有一个示例:

    var title = valueAxis.renderer.gridContainer.createChild(am4core.Label);
    title.text =  "[bold]Price";
    title.fill = series.fill;
    title.isMeasured = false;
    title.y = 8;
    title.x = am4core.percent(50);
    title.align = "center";
    title.textAlign = "middle";
    

    演示:

    https://codepen.io/team/amcharts/pen/3ee9e8c1b01cc6ce4cd8ffe275b18907

    【讨论】:

    • @May 不客气!抱歉回复晚了,现在才看到这条评论。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-14
    • 2021-10-29
    • 2020-10-19
    • 1970-01-01
    相关资源
    最近更新 更多