开发者

Does the dateAxisRenderer in jqPlot ignore the numberTicks option?

I am trying to change the number of ticks present in a plot with jqPlot. I am using the dateAxisRenderer plugin for my x-axis, and want to reduce the number of date ticks displayed. Here is my example code:

var dummyData = [['2011-05开发者_StackOverflow社区-03 10:15:30', 25], ['2011-05-04 11:30:30', 30], ['2011-05-05 10:15:30', 25], ['2011-05-06 11:30:30', 33], '2011-05-07 10:15:30', 25]];

$.jqplot(chartId, [dummyData], {
        grid:{
            //background:'#f0ffff',
            background:'#F0F8FF',
            gridLineColor:'#dfdfdf',
            borderWidth:1.5
        },
        axes:{
            xaxis:{
                pad:1.0,
                renderer:$.jqplot.DateAxisRenderer,
                numberTicks:3,
                tickOptions:{
                    formatString:'%#m/%#d%n%#I%p', 
                    fontSize:'7pt', 
                    fontFamily:'"Lucida Grande",Verdana, Georgia, "Times New Roman", Times, serif'
                }
            },
            yaxis:{padMin:1.01, padMax:1.1, tickOptions:{formatString:'$%d'}}
        },
        seriesDefaults: {
            fill: true,
            fillAndStroke: true,
            shadow:false,
            rendererDefaults: {
                highlightMouseOver:false,
                highlightMouseDown:false,
                highlightColor:null
            },
            markerOptions:{
                show:false,
                size:4
            },
            trendline:{
                show:false,
                type:'exp'
            }

        },
        series:[{color:'rgba(255, 117, 26, 0.7)'}]
});


The $.jqplot.DateAxisRenderer has a tickInterval option.

For example:

    xaxis: {
            pad:1.0,
            renderer:$.jqplot.DateAxisRenderer,
            tickInterval: "7 days",
        },
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜