OPEN_GRID API - v1.5.2
    Preparing search index...

    Interface ChartAdapter

    차트 렌더 어댑터(교체 seam) — 내장 canvas 렌더러와 외부 차트 라이브러리(ECharts 등) 백엔드를 하나의 공통 인터페이스로 감싼다. 내장 렌더러로는 부족해서 다른 차트 라이브러리로 실제 그리는 부분만 바꿔치기하고 싶을 때, 이 인터페이스를 구현해 ChartConfig.engine에 넘긴다.

    Chart render adapter (swap seam) — wraps the built-in canvas renderer and external chart library backends (e.g. ECharts) behind one common interface. Implement this when the built-in renderer isn't enough and you want to swap in a different charting library for the actual drawing, then pass it via ChartConfig.engine.

    チャートのレンダーアダプター(差し替えの seam) — 内蔵 canvas レンダラーと外部チャート ライブラリ(ECharts など)のバックエンドを、一つの共通インターフェースで包みます。内蔵 レンダラーでは足りず、別のチャートライブラリで実際に描く部分だけを差し替えたいときに、この インターフェースを実装して ChartConfig.engine に渡します。

    图表渲染适配器(替换用的 seam) — 用一个共同的接口包裹内置 canvas 渲染器和外部图表库 (如 ECharts)后端。当内置渲染器不够用、只想把实际绘制的部分换成别的图表库时,实现该接口 并传给 ChartConfig.engine

    const myAdapter: ChartAdapter = {
    id: 'my-echarts-adapter',
    // create the chart-lib instance
    async init(host, spec) { echartsInstance = echarts.init(host); },
    // map the model into the lib's format and draw
    render(model, spec) { echartsInstance.setOption(toEchartsOption(model, spec)); },
    // call the lib's resize
    resize(w, h) { echartsInstance.resize({ width: w, height: h }); },
    // tear down the lib instance
    destroy() { echartsInstance.dispose(); },
    };
    interface ChartAdapter {
        id: string;
        destroy(): void;
        init(host: HTMLElement, spec: ChartRenderSpec): Promise<void>;
        onPointClick?(cb: (p: ChartPoint) => void): void;
        render(model: ChartDataModel, spec: ChartRenderSpec): void;
        resize(width: number, height: number): void;
        toBlob?(mime?: string): Promise<Blob | null>;
    }
    Index

    Properties

    id: string

    어댑터 식별자.

    Adapter identifier.

    アダプターの識別子。

    适配器的标识符。

    Methods

    • 어댑터 정리.

      Tear down the adapter.

      アダプターの後始末。

      清理适配器。

      Returns void

    • 호스트에 초기화.

      Initialize into the host.

      ホストへ初期化。

      在宿主元素中初始化。

      Parameters

      Returns Promise<void>

    • 포인트 클릭 콜백 등록(선택).

      Register a point-click callback (optional).

      ポイントクリックのコールバック登録(任意)。

      注册点位点击的回调(可选)。

      Parameters

      Returns void

    • 렌더 영역 크기 변경.

      Resize the render area.

      レンダー領域のサイズ変更。

      调整渲染区域的大小。

      Parameters

      • width: number
      • height: number

      Returns void

    • 현재 렌더를 이미지 Blob 으로(선택).

      Export current render as an image Blob (optional).

      現在のレンダーを画像 Blob として(任意)。

      把当前渲染结果导出为图片 Blob(可选)。

      Parameters

      • Optionalmime: string

      Returns Promise<Blob | null>