答案 0 :(得分:0)
标题只能放在图表的顶部。您可以使用标签来模拟标题功能,使用基于百分比的x / y坐标,但您必须设置自己的边距,因为标签不会像标题那样自动移动图表边距。您必须将autoMargins
设置为false,然后设置自己的图表边距,尤其是marginBottom
,以便为您的标签提供足够的空间以在底部呈现:
var chart = AmCharts.makeChart("chartdiv", {
"type": "serial",
"theme": "light",
"autoMargins": false,
"marginLeft": 50,
"marginRight": 20,
"marginBottom": 100,
"allLabels": [{
"x": "50%",
"align": "middle",
"y": "89%",
"bold": true,
"size": 16,
"text": "My Chart Title"
},{
"x": "50%",
"align": "middle",
"y": "94%",
"text": "My Chart Sub-Title"
}],
// ...
});
这是demo