graylog2-server icon indicating copy to clipboard operation
graylog2-server copied to clipboard

Dark mode: vertical (x-axis) grid lines in line/area/bar charts are drawn in light gray

Open MarekWo opened this issue 1 week ago • 0 comments

Expected Behavior

In dark mode, the vertical grid lines of the x-axis in aggregation charts (line, area, bar) should use the same theme-aware color as the horizontal y-axis grid lines, so they blend into the dark background.

Current Behavior

The horizontal (y-axis) grid lines use the theme color (#06050F in dark mode) and are barely visible, as intended. The vertical (x-axis) grid lines are drawn in bright light gray (rgb(238, 238, 238)), the Plotly default. On a dark background they look like thick white lines at every time tick. They are the most prominent element of the chart and make the data harder to read.

The rendered Plotly layout of an affected widget (read from the chart's _fullLayout in the browser):

xaxis.showgrid  = true
xaxis.gridcolor = "rgb(238, 238, 238)"   // Plotly default, no theme color applied
yaxis.gridcolor = "#06050F"              // theme color

There is no widget option to change the x-axis grid color or hide the grid. The only workaround is switching to light mode.

Possible Solution

Only the y-axis layout sets a theme color for the grid. getDefaultPlotYLayoutSettings.ts sets gridcolor: theme.colors.variant.lightest.default, or a shade of the custom axis color.

The x-axis layout is built in useChartLayoutSettingsWithCustomUnits.ts. It contains only title (from getPlotXTitleSettings.ts) and the ticks/type config. It never sets gridcolor, so Plotly falls back to its light-gray default.

Adding the same theme-based gridcolor to the x-axis layout should fix it, for example:

xaxis: {
  title: getPlotXTitleSettings(theme, config),
  gridcolor: theme.colors.variant.lightest.default,
  ...ticksAndTypeConfig,
},

The !unitFeatureEnabled branch in the same hook needs this too. If axisConfig.xaxis.color is set, the grid could use a shade of it, the same way the y-axis does with colorLevel(color, -4).

Steps to Reproduce (for bugs)

  1. Switch Graylog to dark mode.
  2. Create a dashboard widget with a time-based aggregation (row pivot on timestamp), visualization type Line chart, with any metric (e.g. count()).
  3. Look at the chart: the vertical grid lines at each time tick are bright light gray, while the horizontal grid lines are almost invisible.
  4. Optional: in the browser console, run document.querySelector('.js-plotly-plot')._fullLayout.xaxis.gridcolor. It returns rgb(238, 238, 238).

Context

The lines are distracting on dashboards with many time-series charts. They draw the eye away from the data, especially on charts with low values close to the x-axis.

Your Environment

  • Graylog Version: 7.2.2 (also seen in 7.1.8 and 7.1.9)
  • OpenSearch Version: 2.12.0
  • MongoDB Version: 7.0
  • Operating System: Debian 12, Docker (official graylog/graylog image)
  • Browser version: Google Chrome (current stable)

MarekWo avatar Nov 23 '26 15:11 MarekWo