@idux/charts-core 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @idux/charts-core
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ab38e82: Fix gradient tooltip markers and preserve light and dark tooltip styles when mounting outside the chart. Correct multi-axis and time-axis units, respect injected line themes, and align Gauge, Radar, and rose-chart presentation.
8
+
3
9
  ## 1.2.0
4
10
 
5
11
  ### Minor Changes
@@ -1,4 +1,4 @@
1
1
  export { useChart } from './useChart';
2
- export { useTooltipsFormatter } from './useTooltips';
2
+ export { useTooltipsFormatter, getTooltipsColor } from './useTooltips';
3
3
  export * from './useStripe';
4
4
  export { useReactiveAttrs } from './useReactiveAttrs';
@@ -0,0 +1,8 @@
1
+ import { EChartsType } from 'echarts/core';
2
+ import { ChartProps } from '../types';
3
+ /** Keep theme state on the tooltip itself, including portals created by appendTo. */
4
+ export declare function createTooltipTheme(getContainer: () => HTMLElement | undefined): {
5
+ prepare(options: ChartProps): ChartProps;
6
+ sync(instance: EChartsType): void;
7
+ rendered: () => void;
8
+ };
@@ -1,6 +1,27 @@
1
+ import { Color } from 'echarts';
2
+ interface GradientColorStop {
3
+ offset?: number;
4
+ color?: string;
5
+ }
6
+ interface GradientLikeColor {
7
+ colorStops?: GradientColorStop[];
8
+ }
1
9
  export interface TooltipsFormatItem {
2
10
  name: string;
3
11
  value: string | number;
4
- color?: string;
12
+ /**
13
+ * 图例色块颜色,支持普通颜色字符串(如 `#458FFF`)
14
+ * 或渐变对象(如 `itemStyle.color` 配置的 linear 渐变),
15
+ * 传入渐变时优先取最不透明的色标,同透明度下取更深的颜色。
16
+ */
17
+ color?: string | GradientLikeColor;
5
18
  }
19
+ /**
20
+ * 提取用于 tooltip 色块展示的颜色。
21
+ *
22
+ * 柱体、折线等图形常配置为线性渐变,此时 hover 提示中的竖杠
23
+ * 需要与图形中更深的颜色保持一致,因此优先选择最不透明的色标,同透明度时取亮度最低的颜色。
24
+ */
25
+ export declare function getTooltipsColor(color?: Color | GradientLikeColor | null): string;
6
26
  export declare function useTooltipsFormatter(title: string, list: TooltipsFormatItem[]): string;
27
+ export {};