高图中y轴值之间的间距

时间:2014-04-07 09:18:29

标签: php highcharts

我使用高图表生成图表,就像 - enter image description here

这里我想在y轴值之间留出空间(2510G-48,2530ya-24G等)

我怎么能这样做? 我累了使用 tickPixelInterval ,但它似乎不适用于y轴。

代码是 -

    <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
    <script src="http://code.highcharts.com/highcharts.js"></script>
    <script src="http://code.highcharts.com/modules/exporting.js"> </script>
    <script>
$(function () {
    js_platform = <?php echo json_encode($platform); ?>;
        $('#container').highcharts({
            chart: {
                type: 'bar'
            },
            title: {
                text: 'Overall avalibility of testcases on each platform'
            },
            xAxis: {
            tickPixelInterval: 9000,
                categories: js_platform,
                title: {
                    text: null
                }
            },
            yAxis: {
                min: 0,
                title: {
                    text: 'TestCase Count',
                    align: 'high'
                },

            },


            plotOptions: {
                bar: {
                    dataLabels: {
                        enabled: true
                    }
                }
            },
            legend: {
                layout: 'vertical',
                align: 'right',
                verticalAlign: 'top',
                x: -40,
                y: 100,
                floating: true,
                borderWidth: 1,
                backgroundColor: '#FFFFFF',
                shadow: true
            },
            credits: {
                enabled: false
            },
            series: [{
                data:  [<?php echo join($totalTest, ',') ?>]
            }]
        });
    });
    </script>

<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

1 个答案:

答案 0 :(得分:1)

你应该只是让图表容器更高。

您的问题更多是由于缺少“表面”而不是配置参数。

只需使用样式修改包含div。例如:

<div id="chart" style="height: 600px"></div>

相关问题