用于绘制多线图的Jqplot dateaxisrendrer问题,持续30分钟

时间:2012-09-25 12:20:32

标签: jquery jquery-ui charts jqplot

我正在动态绘制tickinterval ...例如。最后一小时,过去24小时,过去7天......

天和24小时我很好。当我试图在最后一小时重新绘制它时出现问题。 Dateaxisrender从午夜12:00开始呈现图表。我尝试使用最小日期尽可能接近我的数据,但仍然没有运气。我提供tickinterval为毫秒...

这是我在这里俯瞰的东西吗?提前谢谢...... enter image description here

注意: mainArray =数据 dFormat =日期时间的字符串格式

var plot2 = $.jqplot(div, mainArray, {
                        title:chartValue[1],
                        seriesDefaults: {
                            lineWidth:1,
                            markerOptions: { show:true, size:3 },
                            rendererOptions: {
                                smooth: true
                            }
                        },
                        axesDefaults: {
                            labelOptions:{textColor:'#313233', fontSize:'11px',fontWeight:'Bold', fontFamily:'Arial'}
                        },
                        axes:{
                            xaxis:{
                                renderer: $.jqplot.DateAxisRenderer,
                                rendererOptions:{
                                    tickRenderer: $.jqplot.CanvasAxisTickRenderer,
                                    tickInset:0
                                },
                                //tickRenderer:$.jqplot.CanvasAxisTickRenderer,
                                tickOptions:{
                                    autoscale:true,
                                    fontSize:'10px',
                                    fontFamily:'Arial',
                                    angle:-90,
                                    formatString: dFormat
                                },
                                //min: minDate,
                                //max: maxDate,
                                tickInterval:timeInterval
                            },
                            yaxis:{
                                min: 0,
                                max: maxV.length > 1 ? parseInt(maxV) + ((parseInt(maxV)/10)): parseInt(maxV)+2,
                                tickOptions: {
                                    formatString: '%d',
                                    fontSize:'10px',
                                    fontFamily:'Arial',
                                    showGridline: true,
                                    showLabel: true
                                },
                                base: Math.E,
                                forceTickAt0: true
                            }
                        },

                        legend: {
                            show: true,
                            labels: legendNames,
                            //placement: 'outsideGrid'
                            renderer:$.jqplot.EnhancedLegendRenderer,
                            location: 'ne',     // compass direction, nw, n, ne, e, se, s, sw, w.
                            xoffset: 10,        // pixel offset of the legend box from the x (or x2) axis.
                            yoffset: 10        // pixel offset of the legend box from the y (or y2) axis.
                        },

                        cursor:{
                            show:true,
                            style:'auto',
                            followMouse:true,
                            zoom:true,
                            looseZoom:true,
                            showTooltip:false
                        }

                    });

数据通过= [[[18:10:02,1],[18:10:12,1],[18:10:13 ,2],[18:14:10,1],[18:14:15,1],[18:14:20,1],] [[18:15:25,1],[18时十五:30,1]]]就像那样

0 个答案:

没有答案