1

我正在动态绘制滴答间隔。例如。过去一小时,过去 24 小时,过去 7 天……

几天和 24 小时我都很好。当我尝试在最后一小时重新绘制它时,问题就来了。Dateaxisrender 从午夜 12:00 开始渲染图表。我尝试使用与我的数据最接近的最小日期,但仍然没有运气。我以毫秒为单位提供滴答间隔...

那是我在这里俯瞰的东西吗..?提前致谢...在此处输入图像描述

注意:mainArray = data 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:15:30,1]]] 这样

4

0 回答 0