我在下面有一个流动图。你会看到标签被压缩了。我想让刻度之间的宽度确保显示所有标签。标记如下:
<!-- Graph HTML -->
<div id="graph-wrapper">
<div class="graph-info">
<a href="#" id="bars"><span></span></a><a href="#" id="lines" class="active"><span></span>
</a>
</div>
<div class="graph-container">
<div id="graph-lines" style="width: 95%; height: 80%;">
</div>
<div id="graph-bars" style="width: 95%; height: 80%;">
</div>
</div>
<div id="series-check" class="graph-info bottom">
</div>
</div>
<!-- end Graph HTML -->
JS:
var ticks = [];
for (var i = 0; i < graphData[0].data.length; i++) {
ticks.push(graphData[0].data[i][0]);
}
$.plot($('#graph-lines'), graphData, {
series: {
points: {
show: true,
radius: 5
},
lines: {
show: true
},
shadowSize: 0
},
grid: {
color: '#646464',
borderColor: '#fff',
borderWidth: 20,
hoverable: true
},
xaxis: {
//tickColor: 'transparent',
//tickDecimals: 2,
mode: "time",
ticks: ticks,
timeformat: options["timformat"], // "%h:%M
min: new Date(options["GraphMinXValue"]), // min milliseconds from data
max: new Date(options["GraphMaxXValue"]) //max milliseconds from data
},
yaxis: {
min: 0,
show: true
},
pan: {
interactive: true
},
zoom: {
interactive: false
}
});
我真的需要图表上的百分比来允许图表重新调整窗口大小,但我想要的是刻度线的间距自动将图表推得更大。我有溢出:隐藏在包含的 div 上并使用平底锅让用户看到隐藏的溢出。有没有办法来解决这个问题?