gpt4 book ai didi

javascript - jqplot 缩放功能不起作用

转载 作者:行者123 更新时间:2023-11-29 16:15:28 25 4
gpt4 key购买 nike

我想用 jqplot 在浏览器中可视化一些时间序列数据。我的问题是,x 轴值重叠并且不可读。

因此,缩放功能将非常有用。但它不起作用。

请看一下 fiddle ,它不能在 Firefox 上运行,只能在谷歌浏览器上运行:

http://jsbin.com/onufih/9/edit

这是我的代码:

function getTicks() {

var ticks = [];

for (var i = 0; i < data.length; i++) {
var item = data[i];
var dateStr = item[0];
ticks.push(dateStr);
}

return ticks;
}

var overviewChart = $.jqplot('overviewChart', [data], {
title: 'Rotated Axis Text',
axes: {
xaxis: {
renderer: $.jqplot.DateAxisRenderer,
rendererOptions: {
tickRenderer: $.jqplot.CanvasAxisTickRenderer
},
ticks: getTicks(),
tickOptions: {

formatString: '%#m/%#d/%y - %#H h - %#M m - %#S s',
fontSize: '10pt',
fontFamily: 'Tahoma',
angle: -40
}
},
yaxis: {
rendererOptions: {
tickRenderer: $.jqplot.CanvasAxisTickRenderer
},
tickOptions: {
fontSize: '10pt',
fontFamily: 'Tahoma',
angle: 30
}
}
},
series: [{
lineWidth: 4,
markerOptions: {
style: 'square'
}
}],
cursor: {
zoom: true,
looseZoom: true
}
});

最佳答案

您需要将 show: true 添加到您的光标,如 this example .

关于javascript - jqplot 缩放功能不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16874867/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com