mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Chart: Add tooltip styling to theme (#24082)
This commit is contained in:
parent
674bb0d16a
commit
b6eaff46e9
@ -1,28 +1,28 @@
|
|||||||
import type { PropertyValues } from "lit";
|
import { consume } from "@lit-labs/context";
|
||||||
import { css, html, nothing, LitElement } from "lit";
|
|
||||||
import { customElement, property, state } from "lit/decorators";
|
|
||||||
import { styleMap } from "lit/directives/style-map";
|
|
||||||
import { classMap } from "lit/directives/class-map";
|
|
||||||
import { mdiRestart } from "@mdi/js";
|
|
||||||
import type { EChartsType } from "echarts/core";
|
|
||||||
import type { DataZoomComponentOption } from "echarts/components";
|
|
||||||
import { ResizeController } from "@lit-labs/observers/resize-controller";
|
import { ResizeController } from "@lit-labs/observers/resize-controller";
|
||||||
|
import { mdiRestart } from "@mdi/js";
|
||||||
|
import { differenceInMinutes } from "date-fns";
|
||||||
|
import type { DataZoomComponentOption } from "echarts/components";
|
||||||
|
import type { EChartsType } from "echarts/core";
|
||||||
import type {
|
import type {
|
||||||
ECElementEvent,
|
ECElementEvent,
|
||||||
XAXisOption,
|
XAXisOption,
|
||||||
YAXisOption,
|
YAXisOption,
|
||||||
} from "echarts/types/dist/shared";
|
} from "echarts/types/dist/shared";
|
||||||
import { consume } from "@lit-labs/context";
|
import type { PropertyValues } from "lit";
|
||||||
import { differenceInMinutes } from "date-fns";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
|
import { customElement, property, state } from "lit/decorators";
|
||||||
|
import { classMap } from "lit/directives/class-map";
|
||||||
|
import { styleMap } from "lit/directives/style-map";
|
||||||
|
import { getAllGraphColors } from "../../common/color/colors";
|
||||||
import { fireEvent } from "../../common/dom/fire_event";
|
import { fireEvent } from "../../common/dom/fire_event";
|
||||||
|
import { listenMediaQuery } from "../../common/dom/media_query";
|
||||||
|
import { themesContext } from "../../data/context";
|
||||||
|
import type { Themes } from "../../data/ws-themes";
|
||||||
|
import type { ECOption } from "../../resources/echarts";
|
||||||
import type { HomeAssistant } from "../../types";
|
import type { HomeAssistant } from "../../types";
|
||||||
import { isMac } from "../../util/is_mac";
|
import { isMac } from "../../util/is_mac";
|
||||||
import "../ha-icon-button";
|
import "../ha-icon-button";
|
||||||
import type { ECOption } from "../../resources/echarts";
|
|
||||||
import { listenMediaQuery } from "../../common/dom/media_query";
|
|
||||||
import type { Themes } from "../../data/ws-themes";
|
|
||||||
import { themesContext } from "../../data/context";
|
|
||||||
import { getAllGraphColors } from "../../common/color/colors";
|
|
||||||
import { formatTimeLabel } from "./axis-label";
|
import { formatTimeLabel } from "./axis-label";
|
||||||
|
|
||||||
export const MIN_TIME_BETWEEN_UPDATES = 60 * 5 * 1000;
|
export const MIN_TIME_BETWEEN_UPDATES = 60 * 5 * 1000;
|
||||||
@ -487,6 +487,12 @@ export class HaChartBase extends LitElement {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
|
backgroundColor: style.getPropertyValue("--card-background-color"),
|
||||||
|
borderColor: style.getPropertyValue("--divider-color"),
|
||||||
|
textStyle: {
|
||||||
|
color: style.getPropertyValue("--primary-text-color"),
|
||||||
|
fontSize: 12,
|
||||||
|
},
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: style.getPropertyValue("--divider-color"),
|
color: style.getPropertyValue("--divider-color"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user