Skip to content

Commit 43ba928

Browse files
committed
fix(chart) :: change tootltip title colour to be visible
1 parent f7ebba6 commit 43ba928

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- List-valued configuration options, including OIDC paths and trusted audiences, can now be set through environment variables as space-separated lists.
2323
- `sqlpage.fetch_with_meta` now correctly documents server JSON responses sent under `json_body`, not `body`.
2424
- Datagrid rows with an icon or image no longer display an unnecessary en-dash placeholder, and an explicitly empty description remains empty.
25+
- Tooltip title text is now inhertis the same colour as the tooltip text.
2526
- Charts can display reference lines. A row with a `yline` is drawn as a line across the chart at that value of the y axis, with the row's `label` and `color` for its text and its color. Reference lines are rows, so a chart can have as many of them as the query returns. A line follows its axis, so on a `horizontal` bar chart a `yline` is drawn down the chart rather than across it. They are not added to the total of a `stacked` chart, and are not filled in an `area` chart.
2627

2728
## v0.45

sqlpage/sqlpage.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ code {
6060
font-weight: var(--tblr-body-font-weight);
6161
}
6262

63+
.apexcharts-tooltip .apexcharts-tooltip-title {
64+
color: inherit;
65+
}
66+
6367
/** table **/
6468
.table-freeze-headers thead {
6569
position: sticky;

tests/end-to-end/chart-component.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,19 @@ test("draws a rangeBar chart that asks to be stacked", async ({ page }) => {
363363
expect(chart.shapes).toHaveLength(2);
364364
expect(chart.stacked).toBe(false);
365365
});
366+
367+
test("gives the tooltip title the color of the tooltip around it", async ({
368+
page,
369+
}) => {
370+
await renderChart(page, { type: "line" }, A_DAY_OF_WORK);
371+
await page.locator("#test-chart .apexcharts-inner").hover({ force: true });
372+
373+
const title = page.locator("#test-chart .apexcharts-tooltip-title");
374+
await expect(title).toHaveText("Tue");
375+
const colors = await title.evaluate((el) => ({
376+
title: getComputedStyle(el).color,
377+
tooltip: getComputedStyle(el.parentElement as HTMLElement).color,
378+
}));
379+
380+
expect(colors.title).toBe(colors.tooltip);
381+
});

0 commit comments

Comments
 (0)