下面是我的Google图表代码,我遇到了我的左标签“ Total”被切掉的问题,我在这里使用了chartArea.left属性,例如chartArea {left:214,width:500},但没有任何变化。如果有人知道我想念什么?
请查看该屏幕截图,以查看我的图表的显示方式:https://prnt.sc/lkovdg
google.charts.load("current", {packages:['bar']});
google.charts.setOnLoadCallback(drawBarChartAddedExperiences);
function drawBarChartAddedExperiences()
{
var data = new google.visualization.DataTable();
data.addColumn('string', 'Days');
data.addColumn('number', 'New experiences');
if(typeof experiences_added === 'undefined')
{
//do nothing
}
else
{
for (var i = 0; i < experiences_added.length; i++)
{
var dated = ""+experiences_added[i].dated+"";
var events_added = parseInt(experiences_added[i].events_added);
var dated_format = ""+experiences_added[i].dated_format+"";
data.addRow([dated, events_added]);
data.setRowProperty(i, 'dated_format', dated_format);
}
var view = new google.visualization.DataView(data);
/*
view.setColumns([0, 1,
{ calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation"
},
2]);
*/
var options = {
title: new_exp_count,
//width: 5000,
height: 400,
bar: {
groupWidth: "25%",
},
legend: {
position: "none",
},
titleTextStyle: {
fontSize: 22,
bold: true,
color:'#575655',
//italic: true,
fontName: 'sans-serif',
},
hAxes: {
0: {
title: 'Days',
textStyle: {
bold: true,
color:'#575655',
fontSize: 12,
fontName: 'sans-serif',
},
}
},
vAxis: {
title: 'Total',
viewWindow: {min: 0, max: total_new_exp_count},
titleTextStyle: {
bold: true,
fontName: 'sans-serif',
//fontSize: '18',
},
textStyle: {
bold: true,
color:'#575655',
//fontSize: 12,
fontName: 'sans-serif',
},
},
};
var chart = new google.charts.Bar(document.getElementById("new_experiences_in_a_duration"));
//chart.draw(view, options);
chart.draw(view, google.charts.Bar.convertOptions(options));