Flot barWidth quirk

37 views
Skip to first unread message

Glenn Eychaner

unread,
Jun 12, 2023, 12:35:49 PM6/12/23
to Flot graphs
I have found somewhat of a quirky behavior in flot barWidth when dealing with time data. I have a data set pulled from a database giving the number of failures of a component each day. The X-axis is time, in milliseconds (the data is binned by day in the database query), while the Y-axis is number of failures. When I bar graph the data (xaxis: { mode: "time", timeBase: "milliseconds" } ) I find that:
* If there is only one day with failures, the proper bar width is 86,400,000, the number of milliseconds in a day.
* If there is more than one day with failures, the proper bar width is a fraction: 86,400,000 divided by the minimum distance between X-axis points. So if there are failures on consecutive days, barWidth is 1. If there are only failures 2 days or more apart, barWidth is 0.5, and so on.
Am I doing something wrong, or is this expected behavior?
Reply all
Reply to author
Forward
0 new messages