在这个 CodePen 中,我有一个 AmCharts 5 水平哑铃图的工作示例:
https://codepen.io/ronmichael/pen/rNqVvMp?editors=1111
您会看到类别轴标签在购物车的左侧重复了两次。重复由底部附近的 yRenderRight 代码生成:
var yRendererRight = am5xy.AxisRendererY.new(root, {
minGridDistance: 20,
inside: false
});
var yAxisRight = chart.yAxes.push(am5xy.CategoryAxis.new(root, {
maxDeviation: 0.3,
categoryField: "group",
renderer: yRendererRight,
tooltip: am5.Tooltip.new(root, {})
}));
yRendererRight.labels.template.setAll({
multiLocation: 0.5,
visible: true // Make the new axis labels visible
});
yRendererRight.grid.template.setAll({
locationY: 1,
location: 1,
visible: false // Hide the grid lines of the new Y-axis
});
如何修改yRenderRight,让重复标签出现在图表的右侧?