http://www.iteye.com/problems/78581
楼主看看

解决方案 »

  1.   

    xAxis:{ 
        labels:{ 
            step:2; 
        } 

    你可通过设置labels里面的step属性X轴显示的间隔。
      

  2.   

    http://img.my.csdn.net/uploads/201204/12/1334196996_3337.pnghttp://img.my.csdn.net/uploads/201204/12/1334196807_5599.png
      

  3.   

    xAxis:{ 
      tickInterval: 10
    }  
    试试这个看是不是你要的效果
      

  4.   

    http://img.my.csdn.net/uploads/201204/12/1334198473_1207.png.thumb.jpg  再看下图片 
      

  5.   

    tickPixelInterval:10 这个是设置刻度距离的,但是不适用于分类轴。
      

  6.   

    有两个方法:
    1.调整图表的宽度,越宽分配给每个值的宽度越宽
    2.设置pointWidth属性
      plotOptions: {
    column: {
    pointPadding: 0.2,
    pointWidth: 30  //柱子的宽度30px
    }
    }
    设置pointPadding也可以
    你可以试试
      

  7.   

    reversed: true(颠倒排列顺序), allowDecimals: false(显示为整数),tickPixelInterval:50(刻度间隔)
      

  8.   

    http://www.highcharts.com/
    这是highcharts的官网,大家有问题可以到这里寻找答案
      

  9.   

    我刚好碰到这个问题,现已解决
    LZ可以换种方式解决,不一样要从内部改变横轴,可以试着从外部改变
    categories属性接收的是对象,可以现在绘图前将你想要的数据用循环控制,将[x,x,x,x]保存在一个变量里,然后再绘图时直接引用
      

  10.   

    楼主这个问题解决了吗??highcharts 中 x轴的刻度的距离如何设置!!我也解决了好久了!!
      

  11.   

    我也遇到刻度问题,代码是这样的:  请大家帮忙看一下
    var chart1 = new Highcharts.Chart({
                    chart: {
                        renderTo: 'newLineChart',
                        type: 'line',
                        marginRight: 130,
                        marginBottom: 25
                    },
                    xAxis: {
                        type: 'datetime', // 定义时间轴的 类型  
                        maxPadding: 0.05,
                        minPadding: 0.05,
                        tickWidth: 1,//刻度的宽度  
                        lineWidth: 1,//自定义x轴宽度  
                        gridLineWidth: 1,//默认是0,即在图上没有纵轴间隔线  
                        lineColor: '#990000'                },
                    yAxis: {
                        title: {
                            text: '值'
                        },
                        plotLines: [{
                            value: 0,
                            width: 1,
                            color: '#808080'
                        }]
                    },
                    series: [{
                        data:
                            [
                                [1274457600000, 1200],
                                [1274544000000, 1300],
                                [1274630400000, 1250],
                                [1274803200000, 1350]
                            ]
                    }]
                });
      

  12.   

    我的办法是,不要人为设置宽度,和增幅。举例像这样<div id="container" style="width:300px;height:300px"></div>
    $(function () {
        $('#container').highcharts({
            chart: {
                type: 'spline'
            },
            xAxis: {
                labels: {
                    formatter: function() {
                        return dateFormat(this.value); // 
                    }
                }
            },
            series: [{
                name: '重庆',
                data: [
    [Data.UTC(2014,1,1),1526],//Data.UTC()的返回值是number类型的,这个很重要
    [Data.UTC(2014,2,1),4259],
    [Data.UTC(2014,3,1),2542],
    [Data.UTC(2014,4,1),1523],
    [Data.UTC(2014,5,1),5234],
    [Data.UTC(2014,6,1),4235],
    [Data.UTC(2014,7,1),3524],
    [Data.UTC(2014,8,1),2541],
                ]
            }],
        });
    });  
    function dateFormat(time){
    var now = new Date();
    now.setTime(time);
        return now.getFullYear()+"年"+(now.getMonth()+1)+"月"+(now.getDate()); 
    }也就是把X轴的值放入到series的data中去,但是x轴的值必须是number类型才可以,虽然有时候并不分得并理想,比如下面的例子:<div id="container" style="width:300px;height:300px"></div>
    $(function () {
        $('#container').highcharts({
            chart: {
                type: 'spline'
            },
            xAxis: {
                labels: {
                    formatter: function() {
                        return this.value+"个人"; // 
                    }
                }
            },
            series: [{
                name: '第三组',
                data: [
    [1,1326],
    [2,2259],
    [3,3542],
    [4,4523],
    [5,5234],
    [6,6235],
    [7,8524],
    [8,9541],
                ]
            }],
        });
    }); 
      

  13.   

    此贴没有相去甚远,顶上去看看有没有人解答。再描述一下:对于非线性的X轴,是否可以固定每个刻度的宽度?有什么解决办法?
    tickPixelInterval对非线性坐标轴是没有效果的。