任何人都可以帮我水平显示Y轴的标题吗?此外,我希望图形占据整个X轴(整个X轴)。以下是我正在使用的代码:
function createXYZchart() {
var chart = new AmCharts.AmSerialChart();
chart.dataProvider = dataXYZ; //data source
chart.categoryField = "month"; //data provider X-Axis
var categoryAxis = chart.categoryAxis;
categoryAxis.labelRotation = 90;
chart.angle = 60;
chart.depth3D = 5;
chart.columnWidth = 0.85;
var valueAxis = new AmCharts.ValueAxis();
valueAxis.dashLength = 10;
valueAxis.autoGridCount = false;
valueAxis.minimum = 90;
valueAxis.maximum = 100;
valueAxis.gridCount=5;
valueAxis.labelFunction = formatLabel;
chart.addValueAxis(valueAxis);
}
答案 0 :(得分:0)
要使垂直值轴标题水平显示,请使用其titleRotation
属性:(将其设置为0 - 或零旋转)
valueAxis.title = "Y axis";
valueAxis.titleRotation = 0;
要使图表扩展绘图区域的整个宽度,请将categoryAxis
上的startOnAxis
设置为true
:
categoryAxis.startOnAxis = true;