Jqplot图数据不能正常工作

时间:2022-09-15 11:31:27

I'm new in Jqplot, and I have a ploblem with IE11. I'm trying to display a graph with "month" on xaxis. this is my code.

我是Jqplot的新手,我在IE11上有一个问题。我正在尝试在xaxis上显示带有“月份”的图表。这是我的代码。

var line1=[["1", 4],["2", 4],["3", 4], ["4", 6.5], ["5", 5.7], ["6", 9]];
var plot1 = $.jqplot('chart', [line1], {
    title:'Rotated Axis Text',
    axesDefaults: {
            labelRenderer: $.jqplot.CanvasAxisLabelRenderer
    },
    axes:{
        xaxis:{
                label:"test axes des abs",
                pad: 0,
                renderer:$.jqplot.DateAxisRenderer, 
                rendererOptions:{
                        tickRenderer:$.jqplot.CanvasAxisTickRenderer
                },
                tickOptions:{ 
                        fontSize:'10pt', 
                        fontFamily:'Tahoma', 
                        angle:-40,
                        formatString:'%B'
                }
        },

        yaxis:{
            label:'Cosine',
        }                   
    },
   legend: {
            renderer: $.jqplot.EnhancedLegendRenderer,
            show: true,
            showLabels: true,
            location: 'ne',
            placement: 'outside',
            fontSize: '11px',
            fontFamily: ["Lucida Grande","Lucida Sans Unicode","Arial",],
            rendererOptions: {
                 seriesToggle: 'normal'
            }
    },
   series:[{"label":"test des lignes"}],
   cursor:{
            zoom:true,
            looseZoom: true
        }
});

where "chart" is an identifier off the graph container. this works in chrome Jqplot图数据不能正常工作

其中“chart”是图形容器外的标识符。这适用于chrome

But when i use IE only one month is displayed. Jqplot图数据不能正常工作

但是当我使用IE时,只显示一个月。

How can fix it ? Thanks in advance.

怎么解决它?提前致谢。

1 个解决方案

#1


0  

You should provide a less dubious string that can be parsed as date for the x-axis value:

您应该提供一个不太可疑的字符串,可以将其解析为x轴值的日期:

var line1=[["2016-01-01", 4], ["2016-02-01", 4], ["2016-03-01", 4], ["2016-04-01", 6.5], ["2016-05-01", 5.7], ["2016-06-01", 9]];

If in doubt, provide an actual Date object instead of a string.

如果有疑问,请提供实际的Date对象而不是字符串。

Internally, the renderer will call new $.jsDate( your-x-axis-value ), which seemingly yields different results in your browsers for the values you provided.

在内部,渲染器将调用新的$ .jsDate(your-x-axis-value),这似乎会在浏览器中为您提供的值产生不同的结果。

#1


0  

You should provide a less dubious string that can be parsed as date for the x-axis value:

您应该提供一个不太可疑的字符串,可以将其解析为x轴值的日期:

var line1=[["2016-01-01", 4], ["2016-02-01", 4], ["2016-03-01", 4], ["2016-04-01", 6.5], ["2016-05-01", 5.7], ["2016-06-01", 9]];

If in doubt, provide an actual Date object instead of a string.

如果有疑问,请提供实际的Date对象而不是字符串。

Internally, the renderer will call new $.jsDate( your-x-axis-value ), which seemingly yields different results in your browsers for the values you provided.

在内部,渲染器将调用新的$ .jsDate(your-x-axis-value),这似乎会在浏览器中为您提供的值产生不同的结果。