float 中的多个 x 轴刻度集
有谁知道我是否/如何可以在浮动网格中为 x 轴创建多组刻度?我正在绘制一段时间内的数据图表,我希望能够显示特定的刻度线(一个月中的几天),然后显示特定刻度线下的更一般的刻度线(月份)。像这样的东西:
1 2 3 4 5 6 7...1 2 3 4 5 6 7 8.....
JUNE JULY
Does anyone know if/how I can create multiple sets of ticks for the x axis in a flot grid? I'm graphing data over time and I'd like to be able to show specific ticks (days of the month) and then more general ticks (months) under the specific ticks. something like:
1 2 3 4 5 6 7...1 2 3 4 5 6 7 8.....
JUNE JULY
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

因此支持多个 y 轴,如下所示:
http://people. iola.dk/olau/flot/examples/multiple-axes.html
该文档似乎表明您可以有 2 个 x 轴:https://github.com/bluesmoon/yui-flot/wiki/API -Documentation---Axes 但未能真正解释它是如何工作的;
我现在最好的猜测是,您必须拥有多个数据集,因此您必须拥有每日系列和每月系列,并将每个数据集分配给不同的轴。但我还没能让它发挥作用。
而不是我的单个 x 轴:
我正在使用这条线:
到目前为止还没有运气,请告诉我你是否到达任何地方!
更新
好的,明白了 - 您必须将第二个数据集分配给第二个轴,如下所示:
So multiple y-axes are supported as shown here:
http://people.iola.dk/olau/flot/examples/multiple-axes.html
This doc seems to indicate that you can have 2 x-axes: https://github.com/bluesmoon/yui-flot/wiki/API-Documentation---Axes but fails to really explain how it works;
my best guess right now is that you have to have multiple datasets, so you'd have to have a day-by-day series and a month-by-month series, and assign each to a different axis. But I haven't been able to get it to work.
Instead of my single x-axis:
I'm using this line:
No luck so far, tell me if you get anywhere!
UPDATE
OK, got it - you have to assign the second dataset to the second axis like this: