statistic.d.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { View } from '@antv/g2';
  2. import { Datum, Statistic, StatisticText } from '../types';
  3. /**
  4. * @desc 生成 html-statistic 的 style 字符串 (兼容 canvas 的 shapeStyle 到 css样式上)
  5. *
  6. * @param width
  7. * @param style
  8. */
  9. export declare function adapteStyle(style?: StatisticText['style']): object;
  10. /**
  11. * @desc 设置 html-statistic 容器的默认样式
  12. *
  13. * - 默认事件穿透
  14. */
  15. export declare function setStatisticContainerStyle(container: HTMLElement, style: Partial<CSSStyleDeclaration>): void;
  16. /**
  17. * 渲染环图 html-annotation(默认 position 居中 [50%, 50%])
  18. * @param chart
  19. * @param options
  20. * @param meta 字段元信息
  21. * @param {optional} datum 当前的元数据
  22. */
  23. export declare const renderStatistic: (chart: View, options: {
  24. statistic: Statistic;
  25. plotType: string;
  26. }, datum?: Datum) => void;
  27. /**
  28. * 渲染 html-annotation for gauge (等不规则 plot), 默认 position 居中居底 [50%, 100%])
  29. * @param chart
  30. * @param options
  31. * @param meta 字段元信息
  32. * @param {optional} datum 当前的元数据
  33. */
  34. export declare const renderGaugeStatistic: (chart: View, options: {
  35. statistic: Statistic;
  36. }, datum?: Datum) => void;