You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
Google Charts' LineChart produces unpredictable and inconsistent X-axis gridline
spacing when using the timeofday data type, particularly in charts with sliding
windows or dynamic axis ranges. The library ignores configuration parameters for
gridline control and auto-calculates divisions based on pixel-space calculations
rather than respecting explicit time-interval specifications.
PROBLEM DESCRIPTION
OBSERVED BEHAVIOR
When rendering a chart with:
• Data type: addColumn('timeofday', 'Time')
• Data: 360 one-minute-interval data points (6-hour range)
• Display window: Sliding 120-point window (2-hour visible range)
• Configuration: Explicit gridline count parameters
The X-axis gridlines consistently shift between multiple intervals:
• 30-second divisions (2 subdivisions per minute)
• 1-minute divisions (single gridline per minute)
• 2-minute divisions
• 5-minute divisions
• Other arbitrary intervals
This occurs RANDOMLY as the user scrolls the slider, making the chart appear
broken or malfunctioning to end users.
ROOT CAUSE ANALYSIS
Google Charts appears to be calculating gridline positions using internal axis
range mathematics in MILLISECONDS rather than respecting data-based time
intervals. The library:
Converts the visible time range to millisecond deltas
Calculates "nice" numbers for gridline divisions (powers of 2, 5, 10)
Renders gridlines at those calculated positions
IGNORES or overrides explicit configuration parameters
This causes the number and spacing of gridlines to vary based on:
• How many pixels are available for rendering
• The exact pixel width of the chart container
• The visible data range (which changes as the user scrolls)
Render chart and scroll slider to change visible range
OBSERVE: Gridline spacing changes inconsistently as window moves
EXPECTED: Gridlines remain at consistent 5-minute intervals regardless of
scrolling.
IMPACT ASSESSMENT
• User Experience: Appears as a broken/buggy chart
• Data Visualization: Inconsistent axis makes trend analysis difficult
• Accessibility: Creates visual confusion for monitoring applications
TECHNICAL ENVIRONMENT
Affected Versions: Google Charts 1.x (current version as of February 2026)
Tested In: Chrome, Edge, Firefox
PRIORITY SUGGESTION
HIGH - This affects any dashboard or monitoring application using time-series
data with interactive time windows (scrolling, zooming, range selection).
================================================================================
End of Bug Report
GOOGLE CHARTS BUG REPORT
Inconsistent X-Axis Gridlines with timeofday Data Type
================================================================================
SUMMARY
Google Charts' LineChart produces unpredictable and inconsistent X-axis gridline
spacing when using the timeofday data type, particularly in charts with sliding
windows or dynamic axis ranges. The library ignores configuration parameters for
gridline control and auto-calculates divisions based on pixel-space calculations
rather than respecting explicit time-interval specifications.
PROBLEM DESCRIPTION
OBSERVED BEHAVIOR
When rendering a chart with:
• Data type: addColumn('timeofday', 'Time')
• Data: 360 one-minute-interval data points (6-hour range)
• Display window: Sliding 120-point window (2-hour visible range)
• Configuration: Explicit gridline count parameters
The X-axis gridlines consistently shift between multiple intervals:
• 30-second divisions (2 subdivisions per minute)
• 1-minute divisions (single gridline per minute)
• 2-minute divisions
• 5-minute divisions
• Other arbitrary intervals
This occurs RANDOMLY as the user scrolls the slider, making the chart appear
broken or malfunctioning to end users.
ROOT CAUSE ANALYSIS
Google Charts appears to be calculating gridline positions using internal axis
range mathematics in MILLISECONDS rather than respecting data-based time
intervals. The library:
This causes the number and spacing of gridlines to vary based on:
• How many pixels are available for rendering
• The exact pixel width of the chart container
• The visible data range (which changes as the user scrolls)
ATTEMPTED WORKAROUNDS (ALL FAILED)
EXPLICIT COUNT PARAMETERS
javascript code:
gridlines: {color:'numberfomat within controlwrapper type controlType:numberrangefilter #999', count:24},
minorGridlines: {color:'#ddd', count:4}
Result: Ignored by library
SHOWTEXTEVERY PARAMETER
javascript code:
showTextEvery: 5
Result: Parameter doesn't work reliably with timeofday type
EXPLICIT TICKS ARRAY
javascript code:
var ticks = [];
for (var i = 0; i < data.getNumberOfRows(); i += 5) {
ticks.push(data.getValue(i, 0));
}
options.hAxis.ticks = ticks;
Result: Ticks are placed, but gridlines still auto-calculate based on axis
range
TICKINTERVAL SPECIFICATION
javascript code:
hAxis: {tickInterval: [5, 'minute']}
Result: Parameter not supported for timeofday type
CUSTOM SVG GRIDLINE OVERLAY
Result: Works but causes rendering performance issues with frequent redraws
SUCCESSFUL WORKAROUND (Using String Type Instead of timeofday)
The only successful workaround is abandoning timeofday and using string type:
javascript code:
data.addColumn('string', 'Time'); // Instead of 'timeofday'
data.addRows([['14:23:45', 2.5, 0.042], ...])
Then explicitly setting ticks works:
javascript code:
options.hAxis.ticks = ['14:00:00', '14:05:00', '14:10:00', ...];
DISADVANTAGE: Requires manual time formatting and loses automatic
time-formatting capabilities.
EXPECTED BEHAVIOR (DESIRED FIX)
When a user specifies gridline configuration parameters, Google Charts should:
tick positions
axes
(scrolling/zooming)
pixel-space calculations
STEPS TO REPRODUCE
Create a chart with 360+ data points at 1-minute intervals
Use addColumn('timeofday', 'Time')
Implement a sliding window that shows only 120 points
Apply configuration:
javascript code:
gridlines: {count: 24},
minorGridlines: {count: 4}
Render chart and scroll slider to change visible range
OBSERVE: Gridline spacing changes inconsistently as window moves
EXPECTED: Gridlines remain at consistent 5-minute intervals regardless of
scrolling.
IMPACT ASSESSMENT
• User Experience: Appears as a broken/buggy chart
• Data Visualization: Inconsistent axis makes trend analysis difficult
• Accessibility: Creates visual confusion for monitoring applications
TECHNICAL ENVIRONMENT
Affected Versions: Google Charts 1.x (current version as of February 2026)
Tested In: Chrome, Edge, Firefox
PRIORITY SUGGESTION
HIGH - This affects any dashboard or monitoring application using time-series
data with interactive time windows (scrolling, zooming, range selection).
================================================================================
End of Bug Report