stz-util Documentation - v1.5.2
    Preparing search index...

    Class LineChartWrapper

    Hierarchy (View Summary)

    Implements

    Index

    Chart

    • Parameters

      • Optionalid: string

      Returns ChartConfig

      차트 설정 객체를 생성합니다. 이 메소드는 차트의 구성 요소를 종합하여 Chart.js에서 사용할 수 있는 형식으로 반환합니다.

      1.0.0

    Dataset

    • Parameters

      Returns string

      새로운 데이터셋을 추가하고 고유 식별자(UID)를 반환합니다. 데이터셋 배열이 비어있으면 새로 생성합니다.

      데이터셋이 null 또는 undefined일 때 에러를 발생시킵니다.

      1.0.0

    • Protected

      Parameters

      • ds: any
      • idx: number

      Returns void

      데이터셋의 기본적은 옵션을 추가하거나 부여합니다.

      1.0.1

    • Parameters

      • uid: string

      Returns undefined | CustomCartesianDataset<"line">

      데이터셋 배열에서 주어진 UID와 일치하는 데이터셋을 반환합니다. UID가 없거나 데이터셋이 비어있으면 undefined를 반환합니다.

      UID가 없거나 데이터셋이 비어있을 때 에러를 발생시킵니다.

      1.0.0

    • Parameters

      Returns this

      주어진 UID를 가진 데이터셋을 새로운 데이터셋으로 교체합니다. UID가 없거나 데이터셋이 비어있으면 에러를 발생시킵니다.

      UID가 없거나 데이터셋이 비어있을 때 에러를 발생시킵니다.

      1.0.0

    Other

    labels: (string | number)[]
    plugins?: any
    type: "line"
    registry: Map<string, Constructor<any, any>> = ...
    • get chartId(): string

      Returns string

    • set chartId(value: string): void

      Parameters

      • value: string

      Returns void

    • Parameters

      Returns this

      차트에 데이터 라벨을 추가합니다. 기본 옵션을 사용하거나 사용자 정의 옵션을 적용할 수 있습니다.

      Plugins

      1.0.0

      defultDataLabels = false
      
    • Returns {
          _tooltips: WeakMap<WeakKey, any>;
          id: string;
          _handleGroupVisibility(chart: any, datasets: any[]): void;
          _handleLegendClick(
              e: any,
              legendItem: any,
              legend: any,
              toggleBehavior: string,
          ): void;
          _hideTooltip(chart: any): void;
          _hitTestLegend(chart: any, x: number, y: number): any;
          _setupLegendTooltip(chart: any): void;
          _showTooltip(
              chart: any,
              e: MouseEvent,
              tooltipContent: string | ((context: any) => string),
              legendItem: any,
          ): void;
          afterDestroy(chart: any): void;
          afterDraw(chart: any, args: any, options: any): void;
          afterInit(chart: any, args: any, options: any): void;
          beforeUpdate(chart: any, args: any, options: any): void;
      }[]

    • Parameters

      • axis: string

      Returns this

      축에 이미지를 추가합니다.

      이미지 속성이 없는 데이터셋이 있을 경우 에러를 발생시킵니다.

      Scales

      1.0.0

    • Parameters

      • borderWidth: number

      Returns this

    • Parameters

      • xAxisKey: string | false
      • yAxisKey: string | false

      Returns this

      모든 데이터셋의 파싱 키를 설정합니다. xAxisKey와 yAxisKey를 각각 설정할 수 있습니다. false로 설정하면 해당 축에 대한 파싱을 비활성화합니다.

      데이터셋이 존재하지 않을 경우 에러를 발생시킵니다.

      options

      1.0.0

    • Parameters

      • alpha: number

      Returns this

      데이터셋의 배경색에 알파 값을 설정합니다.

      알파 값이 0.0 미만 또는 1.0 초과일 경우 에러를 발생시킵니다.

      1.0.0

      Dataset

    • Parameters

      • datasetIndex: number
      • xAxisKey: string | false
      • yAxisKey: string | false

      Returns this

      특정 데이터셋의 파싱 키를 설정합니다. xAxisKey와 yAxisKey를 각각 설정할 수 있습니다. false로 설정하면 해당 축에 대한 파싱을 비활성화합니다.

      데이터셋이 존재하지 않을 경우 에러를 발생시킵니다.

      options

      1.0.0

    • Parameters

      • xAxisKey: string | false
      • yAxisKey: string | false

      Returns this

      데이터셋의 파싱 키를 설정합니다. xAxisKey와 yAxisKey를 각각 설정할 수 있습니다. false로 설정하면 해당 축에 대한 파싱을 비활성화합니다.

      xAxisKey와 yAxisKey가 모두 false일 경우 에러를 발생시킵니다.

      options

      1.0.0

    • Parameters

      • datasetIndex: number
      • radius: number

      Returns this

      라인 차트의 Point Radius를 설정합니다.

    • Type Parameters

      • TType extends keyof ChartTypeRegistry

      Parameters

      Returns TType extends keyof ChartBuilderMap
          ? ChartBuilderMap[TType<TType>]
          : ChartBuilder<TType>

    • Parameters

      • type: keyof ChartTypeRegistry

      Returns boolean

    • Type Parameters

      • TType extends keyof ChartTypeRegistry
      • TInstance

      Parameters

      Returns void

    Plugins

    • Parameters

      • defaultZoom: boolean = false
      • OptionalzoomOption: object

      Returns this

      줌 기능을 추가합니다. 해당 기능은 플러그인 설치가 필요합니다.

      1.0.0

      defaultZoom = false
      

    Scales

    • Parameters

      • axis: string
      • position: "left" | "right"

      Returns this

      축의 위치를 설정합니다.

      해당 축이 존재하지 않거나 position 옵션을 지원하지 않을 경우 에러를 발생시킵니다.

      1.0.0

    • Parameters

      • axis: "x" | "y"
      • Optionalmin: number
      • Optionalmax: number

      Returns this

      카테시안 차트의 축 범위를 설정합니다. 해당 차트의 스케일을 min, max 를 입력 받은 값으로 고정합니다.

      1.0.0

    • Parameters

      • axis: "x" | "y"
      • gridOptions: { color?: string; display?: boolean; lineWidth?: number }

      Returns this

      카테시안 차트의 그리드 옵션을 설정합니다.

      1.0.0

    • Parameters

      • datasetIndex: number
      • axisId: string = 'y'

      Returns this

      데이터셋에 y축을 설정합니다.

      1.0.0

      axisId = 'y'
      
    • Parameters

      • datasetIndex: number
      • axisID: string

      Returns this

      데이터셋의 yAxisID를 설정합니다.

      해당 차트 타입이 yAxisID 옵션을 지원하지 않을 경우 에러를 발생시킵니다.

      1.0.0

    config

    • Parameters

      • Optionalid: string

      Returns { _chartId: any; data: any; options: any; plugins: any; type: any }

      차트 설정 객체를 생성합니다.

      1.0.0

      use build() Method

    • Protected

      Returns boolean

      라인 차트는 카테고리형 x축일 때 라벨이 필수입니다.

      1.0.0

    dataset

    • Parameters

      • enable: boolean
      • OptionalbackgroundColor: string

      Returns this

      모든 데이터셋의 Fill 설정을 합니다.

      1.0.0

    • Parameters

      • hoverRadius: number

      Returns this

      모든 데이터셋의 Point Hover Radius를 설정합니다.

      1.0.0

    • Parameters

      • radius: number

      Returns this

      모든 라인 차트의 Point Radius를 설정합니다.

      1.0.0

    • Parameters

      • tension: number

      Returns this

      모든 데이터셋의 곡률을 설정합니다.

      1.0.0

    • Parameters

      • datasetIndex: number
      • borderWidth: number

      Returns this

      데이터셋의 Border Width를 설정합니다.

      1.0.0

    • Beta

      Parameters

      Returns void

      특정 데이터셋을 식별자(UID 또는 라벨)로 찾아 새로운 데이터셋으로 교체합니다.

      1.0.0

      chart.setChartData('dataset-uid-or-label', { label: 'New Dataset', data: [10, 20, 30] });
      @beta
    • Parameters

      • datasetIndex: number
      • enable: boolean
      • OptionalbackgroundColor: string

      Returns this

      데이터셋의 Fill 설정을 합니다.

      1.0.0

    • Parameters

      • datasetIndex: number
      • hoverRadius: number

      Returns this

      데이터셋의 Point Hover Radius를 설정합니다.

      1.0.0

    • Parameters

      • datasetIndex: number
      • tension: number

      Returns this

      라인 차트의 곡률을 설정합니다.

      1.0.0

    dataset (기능 테스트 중)

    • Beta

      Returns this

      모든 데이터셋의 그라디언트를 제거합니다.

      1.0.0

    • Beta

      Parameters

      • datasetIndex: number

        대상 데이터셋 인덱스

      Returns this

      지정된 데이터셋의 그라디언트를 제거합니다.

      1.0.0

    • Beta

      Parameters

      • steps: number

        그라디언트 단계

      • colors: string[]

        색상 배열

      • direction: "vertical" | "horizontal" = 'vertical'

        그라디언트 방향 (기본값: vertical)

      Returns this

      모든 데이터셋에 동일한 그라디언트를 적용합니다.

      1.0.0

    • Beta

      Parameters

      • datasetIndex: number

        대상 데이터셋 인덱스

      • steps: number

        그라디언트 단계 (2단계면 0,1 / 3단계면 0,0.5,1)

      • colors: string[]

        색상 배열 (steps와 같은 길이여야 함)

      • direction: "vertical" | "horizontal" = 'vertical'

        그라디언트 방향 (기본값: vertical)

      Returns this

      지정된 데이터셋에 단계별 그라디언트를 적용합니다.

      step 인자는 2 이상만 지원할것입니다.

      1.0.0

    options

    • Beta

      Parameters

      • callback: (chart: Chart<"line">, size: { height: number; width: number }) => void

      Returns this

      차트 리사이즈 이벤트 콜백 함수를 설정합니다.

      1.0.0

    • Parameters

      • color: string

      Returns this

      차트의 캔버스 배경색을 설정합니다.

      1.0.0

      chart.setBackgroundColor('rgba(255, 255, 255, 0.5)');
      chart.setBackgroundColor('#f0f0f0');
    • Parameters

      Returns this

      차트의 범례를 설정합니다.

      1.0.0

      chart.setLegend({
      position: 'bottom',
      align: 'center',
      labels: {
      boxWidth: 40,
      padding: 15,
      font: {
      size: 14,
      weight: 'bold'
      },
      color: '#333',
      usePointStyle: true
      }
      onClick: (e, legendItem, legend) => {
      console.log('Legend clicked:', legendItem);
      }
      });

    options (기능 테스트 중)

    • Beta

      Returns this

      스파크라인 차트 옵션을 적용합니다. mixed 차트에서는 동작하지 않습니다.

      1.0.1

    plugin

    • Parameters

      • plugin: any
      • replaceIfExists: boolean = true

      Returns this

      플러그인을 추가합니다.

      1.0.0

    scales

    • Parameters

      • axis: string
      • gridOptions: GridLineOptions

      Returns this

      축의 그리드 라인 옵션을 설정합니다.

      1.0.0

      chart.setGrid('y', { color: 'rgba(0, 0, 0, 0.1)', lineWidth: 1 });
      

    utility (기능 테스트 중)

    • Private Beta

      Parameters

      • steps: number

        단계 수

      Returns number[]

      0부터 1까지의 위치 배열

      주어진 단계 수에 따라 그라디언트 위치를 계산합니다.

      1.0.0