Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Fill line series symbol with appropriate color in dark mode (#67811)

kevinkelleher12bfb78b8d6a5e
diff --git a/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js b/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js
index f105785b509..beb0a92c2e1 100644
--- a/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js
+++ b/e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js
@@ -3185,7 +3185,10 @@ describe("Issue 42817", () => {
});
it("should be possible to drill down into a question with datetime buckets and a native join (metabase#42817)", () => {
- H.echartsContainer().get("path[fill='#fff']").first().click();
+ H.echartsContainer()
+ .get("path[fill='hsla(0, 0%, 100%, 1.00)']")
+ .first()
+ .click();
H.popover().findByText("See this day by hour").click();
diff --git a/frontend/src/metabase/visualizations/echarts/cartesian/option/series.ts b/frontend/src/metabase/visualizations/echarts/cartesian/option/series.ts
index 0d8b6fcd2a8..d4b2549cc00 100644
--- a/frontend/src/metabase/visualizations/echarts/cartesian/option/series.ts
+++ b/frontend/src/metabase/visualizations/echarts/cartesian/option/series.ts
@@ -626,6 +626,9 @@ const buildEChartsLineAreaSeries = (
);
const blurOpacity = hasMultipleSeries ? CHART_STYLE.opacity.blur : 1;
+ const lineWidth = seriesSettings["line.size"]
+ ? LINE_SIZE[seriesSettings["line.size"]]
+ : LINE_SIZE.M;
return {
emphasis: {
@@ -651,10 +654,9 @@ const buildEChartsLineAreaSeries = (
id: seriesModel.dataKey,
type: "line",
lineStyle: {
+ color: seriesModel.color,
type: seriesSettings["line.style"],
- width: seriesSettings["line.size"]
- ? LINE_SIZE[seriesSettings["line.size"]]
- : LINE_SIZE.M,
+ width: lineWidth,
},
yAxisIndex,
showSymbol: true,
@@ -667,7 +669,10 @@ const buildEChartsLineAreaSeries = (
stack: stackName,
areaStyle:
seriesSettings.display === "area"
- ? { opacity: CHART_STYLE.opacity.area }
+ ? {
+ opacity: CHART_STYLE.opacity.area,
+ color: seriesModel.color,
+ }
: undefined,
encode: {
y: seriesModel.dataKey,
@@ -686,8 +691,11 @@ const buildEChartsLineAreaSeries = (
labelLayout: {
hideOverlap: settings["graph.label_value_frequency"] === "fit",
},
+ symbol: "circle", // default is "emptyCircle", but it's filled with white, so we need to handle the fill ourselves for dark mode
itemStyle: {
- color: seriesModel.color,
+ color: renderingContext.getColor("bg-white"),
+ borderColor: seriesModel.color,
+ borderWidth: lineWidth,
opacity: isSymbolVisible ? 1 : 0, // Make the symbol invisible to keep it for event trigger for tooltip
},
};