Skip to content
Snippets Groups Projects
Unverified Commit 9fb6328c authored by Aleksandr Lesnenko's avatar Aleksandr Lesnenko Committed by GitHub
Browse files

fix hiding incorrect y-axis on hover (#49920)


* fix hiding incorrect y-axis on hover

* Update Loki Snapshots

---------

Co-authored-by: default avatarMetabase Automation <github-automation@metabase.com>
parent 07dfbc2b
No related branches found
No related tags found
No related merge requests found
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Month_Year.png

82.2 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Month_Year.png

82.2 KiB | W: | H:

.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Month_Year.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Month_Year.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Month_Year.png
.loki/reference/chrome_laptop_embed_PublicOrEmbeddedDashboardView_filters_Light_Theme_Date_Filter_Month_Year.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -2,7 +2,9 @@ import { SAMPLE_DB_ID } from "e2e/support/cypress_data";
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
import {
type StructuredQuestionDetails,
chartPathWithFillColor,
createQuestion,
echartsContainer,
getDraggableElements,
modal,
moveDnDKitElement,
......@@ -12,7 +14,7 @@ import {
visitQuestionAdhoc,
} from "e2e/support/helpers";
const { PRODUCTS, PRODUCTS_ID } = SAMPLE_DATABASE;
const { PRODUCTS, PRODUCTS_ID, ORDERS, ORDERS_ID } = SAMPLE_DATABASE;
describe("issue 43075", () => {
const questionDetails: StructuredQuestionDetails = {
......@@ -103,3 +105,51 @@ describe("issue 45255", () => {
cy.findByTestId("funnel-chart").findByText("(empty)");
});
});
describe("issue 49874", () => {
beforeEach(() => {
restore();
cy.signInAsAdmin();
});
it("when two axis should show only one related to the hovered series", () => {
const question = {
dataset_query: {
type: "query",
query: {
"source-table": ORDERS_ID,
aggregation: [
["sum", ["field", ORDERS.QUANTITY, null]],
["sum", ["field", ORDERS.TOTAL, null]],
],
breakout: [
["field", ORDERS.CREATED_AT, { "temporal-unit": "month" }],
],
},
database: 1,
},
display: "bar",
};
visitQuestionAdhoc(question);
echartsContainer().within(() => {
cy.findByText("Sum of Quantity").should("be.visible");
cy.findByText("Sum of Total").should("be.visible");
});
chartPathWithFillColor("#88BF4D").first().realHover();
echartsContainer().within(() => {
cy.findByText("Sum of Quantity").should("be.visible");
cy.findByText("Sum of Total").should("not.exist");
});
chartPathWithFillColor("#98D9D9").first().realHover();
echartsContainer().within(() => {
cy.findByText("Sum of Quantity").should("not.exist");
cy.findByText("Sum of Total").should("be.visible");
});
});
});
......@@ -94,8 +94,8 @@ export const useChartEvents = (
const hiddenYAxisIndex = chartModel.leftAxisModel?.seriesKeys.includes(
hoveredSeriesDataKey,
)
? 0
: 1;
? 1
: 0;
yAxisShowOption[hiddenYAxisIndex].show = false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment