谷歌图表 y 轴标签未显示

发布于 2025-01-20 00:30:53 字数 2060 浏览 3 评论 0原文

我正在使用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);
}

enter image description here

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文