谷歌图表 y 轴标签未显示
我正在使用Google图表,但是有一个问题我不知道它出了什么问题。 当我以正常模式使用图表时,显示了Yaxis标签,但是当我将图表放入模式时,未显示标签时,您可以告诉您为什么吗? 检查下面添加的代码
请提前
,以帮助我帮助我的图表代码: -
google.charts.load('current', {
'packages': ['corechart']
});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Sales'],
['<?php echo $chart_year_arr[5] ?>', <?php echo $filterd_chart_arr[0] ?>],
['<?php echo $chart_year_arr[4] ?>', <?php echo $filterd_chart_arr[1] ?>],
['<?php echo $chart_year_arr[3] ?>', <?php echo $filterd_chart_arr[2] ?>],
['<?php echo $chart_year_arr[2] ?>', <?php echo $filterd_chart_arr[3] ?>],
['<?php echo $chart_year_arr[1] ?>', <?php echo $filterd_chart_arr[4] ?>],
['<?php echo $chart_year_arr[0] ?>', <?php echo $filterd_chart_arr[5] ?>]
]);
var options = {
title: '',
curveType: 'function',
legend: {
position: 'bottom'
},
height: 500,
width: 500,
vAxis: {
ticks: [
{v: 0, f: '0',},
{v: 10, f: '10'},
{v: 20, f: '20'},
{v: 30, f: '30'},
{v: 40, f: '40'},
{v: 50, f: '50'},
{v: 60, f: '60'},
{v: 70, f: '70'},
{v: 80, f: '80'},
{v: 90, f: '90'},
{v: 100, f: '100'}
]
}
};
var chart = new google.visualization.LineChart(document.getElementById('<?php echo $chart_container ?>'));
chart.draw(data, options);
}
I am using google chart but there was one issue I don't know what's going wrong with it.
When I use the chart in normal mode yaxis labels are shown but when i put the chart in modal the labels are not shown can you please tell Why?. please check the code added below
Thanx in advance for helping me
my chart code:-
google.charts.load('current', {
'packages': ['corechart']
});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Sales'],
['<?php echo $chart_year_arr[5] ?>', <?php echo $filterd_chart_arr[0] ?>],
['<?php echo $chart_year_arr[4] ?>', <?php echo $filterd_chart_arr[1] ?>],
['<?php echo $chart_year_arr[3] ?>', <?php echo $filterd_chart_arr[2] ?>],
['<?php echo $chart_year_arr[2] ?>', <?php echo $filterd_chart_arr[3] ?>],
['<?php echo $chart_year_arr[1] ?>', <?php echo $filterd_chart_arr[4] ?>],
['<?php echo $chart_year_arr[0] ?>', <?php echo $filterd_chart_arr[5] ?>]
]);
var options = {
title: '',
curveType: 'function',
legend: {
position: 'bottom'
},
height: 500,
width: 500,
vAxis: {
ticks: [
{v: 0, f: '0',},
{v: 10, f: '10'},
{v: 20, f: '20'},
{v: 30, f: '30'},
{v: 40, f: '40'},
{v: 50, f: '50'},
{v: 60, f: '60'},
{v: 70, f: '70'},
{v: 80, f: '80'},
{v: 90, f: '90'},
{v: 100, f: '100'}
]
}
};
var chart = new google.visualization.LineChart(document.getElementById('<?php echo $chart_container ?>'));
chart.draw(data, options);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论