OPEN_GRID API - v1.3.1
    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.

    const myAdapter: ChartAdapter = {
    id: 'my-echarts-adapter',
    // 차트 라이브러리 인스턴스 생성 / create the chart-lib instance
    async init(host, spec) { echartsInstance = echarts.init(host); },
    // model.categories/series 를 라이브러리 포맷으로 변환해 그리기 / map the model into the lib's format and draw
    render(model, spec) { echartsInstance.setOption(toEchartsOption(model, spec)); },
    // 라이브러리 resize 호출 / 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).

      Parameters

      • Optionalmime: string

      Returns Promise<Blob | null>