Skip to content

Commit bfa5dd9

Browse files
committed
boxplot supports dark theme
1 parent a633ea1 commit bfa5dd9

File tree

2 files changed

+204036
-204003
lines changed

2 files changed

+204036
-204003
lines changed

appserver/static/visualizations/boxplot/src/visualization_source.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ function(
1414
SplunkVisualizationUtils
1515
) {
1616

17+
var isDarkTheme = SplunkVisualizationUtils.getCurrentTheme &&
18+
SplunkVisualizationUtils.getCurrentTheme() === 'dark';
19+
1720
return SplunkVisualizationBase.extend({
1821

1922
initialize: function() {
@@ -116,6 +119,7 @@ function(
116119
return {
117120
type: 'box',
118121
y: boxValues[i],
122+
hoverinfo: 'x+y',
119123
name: boxLabels[i],
120124
boxmean: plotMean,
121125
boxpoints: plotPoints
@@ -129,16 +133,29 @@ function(
129133
margin: {
130134
t: 50
131135
},
136+
137+
paper_bgcolor: isDarkTheme ? "transparent" : "#fff",
138+
plot_bgcolor: isDarkTheme ? "transparent" : "#fff",
139+
font: {
140+
color: isDarkTheme ? '#DCDCDC' : '#444',
141+
},
142+
143+
legend: {
144+
bgcolor: isDarkTheme ? '#212527' : '#fff',
145+
},
132146
showlegend: dispLegend,
147+
133148
xaxis: {
134149
autorange: true,
135150
tickangle: xTickAngle,
136151
title: xAxisLabel,
152+
gridcolor: isDarkTheme ? "#A6A6A6" : "#eee"
137153
},
138154
yaxis: {
139155
zeroline: false,
140156
autorange: true,
141157
tickangle: yTickAngle,
158+
gridcolor: isDarkTheme ? "#A6A6A6" : "#eee",
142159
title: yAxisLabel
143160
}
144161
};

0 commit comments

Comments
 (0)