Stock Chart.

PRO

가격 이력과 금융 탐색 기능을 함께 제공합니다.

Live preview기능별 예제 13개

LIVE EXAMPLE

가격 탐색

페이지 테마에 맞춰 표시
차트를 조작하면 선택·범위 변경 결과가 여기에 표시됩니다.
옵션변경 사항이 미리보기와 코드에 반영됩니다.
표현과 스타일9
제목과 크기3

Navigator와 기간 선택기로 가격 이력을 탐색합니다. 모든 값은 예시 데이터입니다.

코드 보기
현재 미리보기
<div id="chart-container" style="width: 100%; min-width: 0;"></div>

<script type="module">
  import { defineCustomElement as define0 } from '@syidax/advanced-pro/components/sy-stock-chart.js';
  define0();

  // Pro: 앱 시작 시 발급받은 인증서로 registerLicense를 완료하세요.
  // 홈페이지 미리보기의 인증서는 고객 앱에서 사용하지 않습니다.
  const specs = [
    {
      "id": "example-chart",
      "tag": "sy-stock-chart",
      "props": {
        "data": [
          {
            "time": 1767225600000,
            "open": 100,
            "close": 95,
            "high": 103,
            "low": 92,
            "volume": 1200
          },
          {
            "time": 1767312000000,
            "open": 104,
            "close": 106,
            "high": 109,
            "low": 101,
            "volume": 1337
          },
          {
            "time": 1767398400000,
            "open": 107,
            "close": 105,
            "high": 110,
            "low": 102,
            "volume": 1474
          },
          {
            "time": 1767484800000,
            "open": 109,
            "close": 114,
            "high": 117,
            "low": 106,
            "volume": 1611
          },
          {
            "time": 1767571200000,
            "open": 108,
            "close": 109,
            "high": 112,
            "low": 105,
            "volume": 1748
          },
          {
            "time": 1767657600000,
            "open": 106,
            "close": 103,
            "high": 109,
            "low": 100,
            "volume": 1885
          },
          {
            "time": 1767744000000,
            "open": 102,
            "close": 106,
            "high": 109,
            "low": 99,
            "volume": 2022
          },
          {
            "time": 1767830400000,
            "open": 100,
            "close": 100,
            "high": 103,
            "low": 97,
            "volume": 2159
          },
          {
            "time": 1767916800000,
            "open": 98,
            "close": 94,
            "high": 101,
            "low": 91,
            "volume": 2296
          },
          {
            "time": 1768003200000,
            "open": 99,
            "close": 102,
            "high": 105,
            "low": 96,
            "volume": 2433
          },
          {
            "time": 1768089600000,
            "open": 101,
            "close": 100,
            "high": 104,
            "low": 97,
            "volume": 2570
          },
          {
            "time": 1768176000000,
            "open": 105,
            "close": 100,
            "high": 108,
            "low": 97,
            "volume": 2707
          },
          {
            "time": 1768262400000,
            "open": 109,
            "close": 111,
            "high": 114,
            "low": 106,
            "volume": 2844
          },
          {
            "time": 1768348800000,
            "open": 113,
            "close": 111,
            "high": 116,
            "low": 108,
            "volume": 2981
          },
          {
            "time": 1768435200000,
            "open": 115,
            "close": 120,
            "high": 123,
            "low": 112,
            "volume": 1318
          },
          {
            "time": 1768521600000,
            "open": 115,
            "close": 116,
            "high": 119,
            "low": 112,
            "volume": 1455
          },
          {
            "time": 1768608000000,
            "open": 114,
            "close": 111,
            "high": 117,
            "low": 108,
            "volume": 1592
          },
          {
            "time": 1768694400000,
            "open": 111,
            "close": 115,
            "high": 118,
            "low": 108,
            "volume": 1729
          },
          {
            "time": 1768780800000,
            "open": 108,
            "close": 108,
            "high": 111,
            "low": 105,
            "volume": 1866
          },
          {
            "time": 1768867200000,
            "open": 105,
            "close": 101,
            "high": 108,
            "low": 98,
            "volume": 2003
          },
          {
            "time": 1768953600000,
            "open": 105,
            "close": 108,
            "high": 111,
            "low": 102,
            "volume": 2140
          },
          {
            "time": 1769040000000,
            "open": 107,
            "close": 106,
            "high": 110,
            "low": 103,
            "volume": 2277
          },
          {
            "time": 1769126400000,
            "open": 110,
            "close": 105,
            "high": 113,
            "low": 102,
            "volume": 2414
          },
          {
            "time": 1769212800000,
            "open": 114,
            "close": 116,
            "high": 119,
            "low": 111,
            "volume": 2551
          },
          {
            "time": 1769299200000,
            "open": 119,
            "close": 117,
            "high": 122,
            "low": 114,
            "volume": 2688
          },
          {
            "time": 1769385600000,
            "open": 121,
            "close": 126,
            "high": 129,
            "low": 118,
            "volume": 2825
          },
          {
            "time": 1769472000000,
            "open": 123,
            "close": 124,
            "high": 127,
            "low": 120,
            "volume": 2962
          },
          {
            "time": 1769558400000,
            "open": 121,
            "close": 118,
            "high": 124,
            "low": 115,
            "volume": 1299
          },
          {
            "time": 1769644800000,
            "open": 119,
            "close": 123,
            "high": 126,
            "low": 116,
            "volume": 1436
          },
          {
            "time": 1769731200000,
            "open": 116,
            "close": 116,
            "high": 119,
            "low": 113,
            "volume": 1573
          },
          {
            "time": 1769817600000,
            "open": 113,
            "close": 109,
            "high": 116,
            "low": 106,
            "volume": 1710
          },
          {
            "time": 1769904000000,
            "open": 112,
            "close": 115,
            "high": 118,
            "low": 109,
            "volume": 1847
          }
        ],
        "session": "24x7",
        "seriesStyle": "candlestick",
        "showNavigator": true,
        "showRangeSelector": true,
        "width": 640,
        "height": 440,
        "brandPosition": "bottom-right",
        "brandLogo": ""
      }
    }
  ];
  const container = document.querySelector('#chart-container');
  const elements = specs.map(({ tag, id, props }) => {
    const element = document.createElement(tag);
    element.id = id;
    Object.assign(element, props);
    element.setAttribute('aria-label', 'stock-chart 예제 차트');
    return element;
  });
  container.replaceChildren(...elements);
  const chart = elements.at(-1);
  const onEvent = event => {
    console.log('flagClick', event.detail);
  };
  chart.addEventListener('flagClick', onEvent);
  const observer = new ResizeObserver(([entry]) => {
    const width = Math.max(160, Math.floor(entry.contentRect.width));
    elements.forEach(element => { element.width = width; });
  });
  observer.observe(container);

  // SPA에서는 화면이 해제될 때 이 함수를 호출하세요.
  function disposeChart() {
    observer.disconnect();
    chart.removeEventListener('flagClick', onEvent);
    container.replaceChildren();
  }
</script>

사용과 데이터

#

기간 선택·Navigator·플래그를 갖춘 금융 화면을 구성하세요.

날짜의 시간대와 거래 세션을 맞추세요. 예제는 가상 데이터이며 표시 기능의 사용법입니다.

데이터 계약

프로퍼티입력 형식
data시간순 OHLCV 데이터입니다.
session24x7 또는 거래 세션을 지정합니다.
flagstime·text·title을 가진 이벤트 목록입니다.
seriesStyle가격을 그리는 표현입니다.

데이터를 갱신할 때

배열 안의 값을 직접 바꾸기보다 새 배열·객체를 프로퍼티에 할당하세요. 차트의 이벤트는 event.detail로 선택 결과를 전달합니다. 화면을 해제할 때 ResizeObserver와 앱에서 등록한 이벤트 리스너를 정리하세요.

기능별 예제

#

13개의 기능 예제를 직접 조작하고 코드를 확인하세요. ‘미리보기에서 편집’을 누르면 위 설정 패널에서 옵션을 더 조합할 수 있습니다.

할로 캔들PRO

상승 캔들의 몸통을 비워 가격 흐름을 봅니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

면적형 가격PRO

가격 추이를 면적으로 표시합니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

기간 탐색PRO

기간 선택기와 Navigator로 관심 구간을 고릅니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

OverviewPRO

Overview의 20가지 예제를 비교합니다. 예제 안의 버튼과 아래 옵션을 조작하면 실행 결과와 적용 코드가 함께 바뀝니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

DashboardPRO

Dashboard의 2가지 예제를 비교합니다. 예제 안의 버튼과 아래 옵션을 조작하면 실행 결과와 적용 코드가 함께 바뀝니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

DrawingPRO

Drawing의 8가지 예제를 비교합니다. 예제 안의 버튼과 아래 옵션을 조작하면 실행 결과와 적용 코드가 함께 바뀝니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

Highcharts GalleryPRO

Highcharts Gallery의 14가지 예제를 비교합니다. 예제 안의 버튼과 아래 옵션을 조작하면 실행 결과와 적용 코드가 함께 바뀝니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

NavigationPRO

Navigation의 7가지 예제를 비교합니다. 예제 안의 버튼과 아래 옵션을 조작하면 실행 결과와 적용 코드가 함께 바뀝니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

OscillatorsPRO

Oscillators의 15가지 예제를 비교합니다. 예제 안의 버튼과 아래 옵션을 조작하면 실행 결과와 적용 코드가 함께 바뀝니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

OverlaysPRO

Overlays의 18가지 예제를 비교합니다. 예제 안의 버튼과 아래 옵션을 조작하면 실행 결과와 적용 코드가 함께 바뀝니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

StylesPRO

Styles의 16가지 예제를 비교합니다. 예제 안의 버튼과 아래 옵션을 조작하면 실행 결과와 적용 코드가 함께 바뀝니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

WorkspacePRO

Workspace의 4가지 예제를 비교합니다. 예제 안의 버튼과 아래 옵션을 조작하면 실행 결과와 적용 코드가 함께 바뀝니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

Streaming · 실시간 데이터 추가와 갱신PRO

실시간 데이터 추가와 갱신의 1가지 예제를 비교합니다. 예제 안의 버튼과 아래 옵션을 조작하면 실행 결과와 적용 코드가 함께 바뀝니다.

차트를 조작하면 결과 값이 여기에 표시됩니다.
코드 보기

API 레퍼런스

#

sy-stock-chart의 전체 공개 API입니다. 객체와 배열은 JavaScript 프로퍼티로 전달하세요. 이름을 선택하면 적용 코드와 타입 계약을 확인할 수 있습니다.

주요 속성

속성 / 프로퍼티타입 / 기본값설명
number기본값 760차트의 너비(px). 컨테이너가 바뀌면 ResizeObserver로 갱신합니다.
number기본값 420차트의 높이(px).
brandLogostring기본값 undefined기본값은 Syidax 로고입니다. Pro의 chart.branding 권한으로 none 또는 PNG·JPEG·WebP data URL을 사용할 수 있습니다.
brandPosition'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'기본값 'bottom-right'로고를 고정할 코너입니다. Community·Pro, 화면과 이미지 내보내기에 동일하게 적용됩니다.
StockDataInput기본값 undefined시간순 OHLCV 데이터입니다.
'24x7' | 'us-equity' | StockSessionInput기본값 '24x7'24x7 또는 거래 세션을 지정합니다.
showNavigatorboolean기본값 falseHTML attribute 또는 JavaScript 프로퍼티로 설정합니다. 타입: boolean.
showRangeSelectorboolean기본값 falseHTML attribute 또는 JavaScript 프로퍼티로 설정합니다. 타입: boolean.
StockResolution기본값 '1d'Tape resolution: `1d` raw / `1w` / `1M` calendar roll-ups.
seriesStyleStockSeriesStyle | DerivedStockStyle기본값 'candlestick'가격을 그리는 표현입니다.
upColorstring기본값 '#16a34a'Up/down candle colours (close ≥ open → up).
downColorstring기본값 '#dc2626'HTML attribute 또는 JavaScript 프로퍼티로 설정합니다. 타입: string.
boolean기본값 trueHTML attribute 또는 JavaScript 프로퍼티로 설정합니다. 타입: boolean.
showLegendboolean기본값 trueHTML attribute 또는 JavaScript 프로퍼티로 설정합니다. 타입: boolean.
ReadonlyArray<StockFlagInput>기본값 undefinedtime·text·title을 가진 이벤트 목록입니다.
showToolbarboolean기본값 falseHTML attribute 또는 JavaScript 프로퍼티로 설정합니다. 타입: boolean.
chartTitlestring기본값 undefined차트 내부 제목입니다. 데이터의 단위와 의미를 함께 설명하세요.
chartSubtitlestring기본값 undefined차트 내부 부제목입니다.
나머지 속성 24
속성 / 프로퍼티타입 / 기본값설명
visibleFromnumber기본값 undefinedVisible bar range (indices; defaults to everything).
visibleTonumber기본값 undefinedHTML attribute 또는 JavaScript 프로퍼티로 설정합니다. 타입: number.
dataGroupingstring기본값 'auto'View-density grouping: `auto` (default) / `off` / a forced factor.
historyLoader(oldestTime: number, count: number) => Promise<ReadonlyArray<StockBarInput>> | ReadonlyArray<StockBarInput>기본값 undefinedJavaScript 프로퍼티로 전달합니다. 타입: (oldestTime: number, count: number) => Promise<ReadonlyArray<StockBarInput>> | ReadonlyArray<StockBarInput>.
historyThresholdnumber기본값 30Bars from the head that trigger a history load (default 30).
ReadonlyArray<PaneSpecInput>기본값 undefinedJavaScript 프로퍼티로 전달합니다. 타입: ReadonlyArray<PaneSpecInput>.
brickSizenumber기본값 undefinedRenko brick size in price units (default auto — close range/50, nice).
reversalPctnumber기본값 4Kagi reversal, percent (default 4).
boxSizenumber기본값 undefinedPoint & Figure box size (default auto) and reversal boxes (default 3).
reversalBoxesnumber기본값 3HTML attribute 또는 JavaScript 프로퍼티로 설정합니다. 타입: number.
lineBreakCountnumber기본값 3Line Break lookback (default 3-line break).
baselineValuenumber기본값 undefinedBaseline anchor for `series-style="baseline"` (default first visible close).
lineColorstring기본값 '#2563eb'Line/area/hilo ink.
priceScaleModestring기본값 'linear'Right-scale space: `linear` (default) / `log` / `percent` / `indexed`.
referenceLinesstring기본값 undefinedReference lines, comma list: `current,previous-close,high,low,bid,ask`.
number기본값 undefinedQuotes for the `bid`/`ask` reference lines.
number기본값 undefinedHTML attribute 또는 JavaScript 프로퍼티로 설정합니다. 타입: number.
compareSymbolsReadonlyArray<CompareSymbolInput>기본값 undefinedJavaScript 프로퍼티로 전달합니다. 타입: ReadonlyArray<CompareSymbolInput>.
ReadonlyArray<StockIndicatorInput>기본값 undefinedJavaScript 프로퍼티로 전달합니다. 타입: ReadonlyArray<StockIndicatorInput>.
ReadonlyArray<StockDrawingInput>기본값 undefinedJavaScript 프로퍼티로 전달합니다. 타입: ReadonlyArray<StockDrawingInput>.
exportScalenumber기본값 2HTML attribute 또는 JavaScript 프로퍼티로 설정합니다. 타입: number.
string기본값 'en-US'HTML attribute 또는 JavaScript 프로퍼티로 설정합니다. 타입: string.
ReadonlyArray<StockTradeInput>기본값 undefinedJavaScript 프로퍼티로 전달합니다. 타입: ReadonlyArray<StockTradeInput>.
ReadonlyArray<StockPositionInput>기본값 undefinedJavaScript 프로퍼티로 전달합니다. 타입: ReadonlyArray<StockPositionInput>.
이벤트 19
이벤트detail 타입설명
{ bars: number; visibleBars: number; renderMs: number }차트 그리기가 완료되면 렌더링 결과를 detail로 전달합니다.
{ panes: Array<{ id: string; weight: number }> }The pane stack changed (drag, add/remove/reorder, weight set).
{ from: number; to: number }The visible window changed (navigator/scrollbar; fires on release).
{ range: StockRangeKey; from: number; to: number }A range button was applied.
{ resolution: StockResolution }The resolution changed.
{ oldestTime: number; count: number }A history load started / finished.
{ added: number; exhausted: boolean }CustomEvent.detail 타입: { added: number; exhausted: boolean }. 이벤트 이름은 대소문자를 구분합니다.
{ index: number; time: number; price: number } | nullThe crosshair moved to a bar (`null` on leave).
{ ids: string[] }The compare set changed.
{ id: string; time: number; text: string; title?: string }A flag was clicked / hovered (`null` on hover leave).
{ id: string; time: number; text: string; title?: string } | nullCustomEvent.detail 타입: { id: string; time: number; text: string; title?: string } | null. 이벤트 이름은 대소문자를 구분합니다.
{ ids: string[] }The indicator set changed (add/remove/update).
{ count: number; canUndo: boolean; canRedo: boolean }The drawing document changed (add/update/move/remove/undo/redo/load).
{ id: string } | nullA drawing was selected (`null` on deselect).
{ tool: string | null }The active placement tool changed (`null` = the cursor).
{ appended: boolean; time: number; close: number; bars: number }A live tick was applied (`appended` = a new bar opened).
{ id: string; time: number; side: 'buy' | 'sell'; price: number; quantity?: number }A trade marker was clicked.
{ applied: string[] }A template was imported (`applied` names the fields that landed).
{ format: string; filename: string }An export finished (`png` | `svg` | `csv`).
메서드 45

Stencil 메서드는 Promise를 반환합니다. async 함수에서 await로 결과를 받으세요.

메서드 / 인수반환 타입설명
symbol: CompareSymbolInputPromise<void>Add a compare overlay (duplicate ids replace).
id: stringPromise<void>Remove a compare overlay by id.
spec: StockIndicatorInputPromise<StockIndicatorInput>Add an indicator instance (an explicit duplicate id replaces). A missing id is minted HERE and persisted into the spec, so later removals never re-number method-added instances.
id: stringPromise<void>Remove an indicator by resolved id (its synthesized pane goes with it).
id: string, params: Record<string, number | string>Promise<void>Merge params into an instance (by resolved id).
Promise<Array<{ id: string; kind: string; params: Record<string, number>; linkedTo: string; paneId: string | null; label: string; }>>Resolved indicator list (serialisable — no definition objects).
definition: IndicatorDefinitionPromise<{ ok: boolean; errors: string[] }>비동기 메서드입니다. 아래 인수 타입과 반환 타입을 확인하세요.
kind: stringPromise<{ removed: boolean }>Remove a definition; live instances of the kind resolve away.
Promise<string[]>Registered indicator kinds (built-ins + custom), sorted.
id: stringPromise<Record<string, Array<number | null>> | null>Computed columns for one instance over the current render tape.
input: StockDrawingInputPromise<StockDrawing | null>Add a drawing (data-coordinate anchors); returns it with the minted id.
id: string, patch: Partial<Omit<StockDrawing, 'id'>>Promise<void>Merge a patch (anchors/style/meta/visible/locked) into a drawing.
id: string, deltaTime: number, deltaPrice: numberPromise<void>Translate a drawing by data-space deltas (locked drawings hold).
id: stringPromise<void>비동기 메서드입니다. 아래 인수 타입과 반환 타입을 확인하세요.
Promise<void>비동기 메서드입니다. 아래 인수 타입과 반환 타입을 확인하세요.
Promise<{ count: number; canUndo: boolean; canRedo: boolean }>비동기 메서드입니다. 아래 인수 타입과 반환 타입을 확인하세요.
Promise<{ count: number; canUndo: boolean; canRedo: boolean }>비동기 메서드입니다. 아래 인수 타입과 반환 타입을 확인하세요.
Promise<StockDrawing[]>The current document (deep-copied, serialisable).
Promise<string>Versioned JSON export of the document.
json: stringPromise<number>Restore a serialized document (undoable — it goes through the history).
id: stringPromise<Array<{ x: number; y: number }> | null>Projected css-px points for one drawing on the CURRENT render tape.
tool: string | nullPromise<void>Activate a placement tool (`null` = the select cursor).
Promise<string | null>비동기 메서드입니다. 아래 인수 타입과 반환 타입을 확인하세요.
scale: number, anchorFraction?: numberPromise<{ from: number; to: number }>Zoom programmatically around an anchor fraction (default centre).
bars: numberPromise<{ from: number; to: number }>Pan programmatically by (ungrouped) bars.
data: StockDataInputPromise<void>Replace the bar set.
tick: StockTickInputPromise<{ appended: boolean; time: number } | null>비동기 메서드입니다. 아래 인수 타입과 반환 타입을 확인하세요.
ticks: ReadonlyArray<StockTickInput>Promise<{ appended: boolean; time: number } | null>Batch ticks in ONE repaint (returns the last applied result).
Promise<string>비동기 메서드입니다. 아래 인수 타입과 반환 타입을 확인하세요.
json: stringPromise<{ ok: boolean; applied: string[] }>Apply a template (per-field whitelist; drawings land undoably).
Promise<string | null>The composed standalone SVG snapshot (canvas raster + SVG chrome + the brand).
Promise<string>The tape as a CSV table (ISO time, OHLC, volume).
Promise<void>Download the composed snapshot as a PNG at `export-scale`. The grant is confirmed again after the rasterisation await: one lost (or changed) meanwhile rejects with the §4.1 `stale` refusal — no download, no `exported`.
Promise<void>Download the composed snapshot as an SVG file (composed and saved in one turn, under a confirmed grant).
Promise<void>Download the tape as a CSV file (under a confirmed grant; getCSV stays the ungated read).
Promise<void>Print view with the inlined snapshot (the facade `print` mirror), opened under a confirmed grant.
Promise<{ bars: number; from: number; to: number }>Normalised bar count + visible range (diagnostics/tooling).
Promise<{ panes: Array<{ id: string; top: number; height: number }> }>Current pane rects (layout-local px).
pane: PaneSpecInput, at?: numberPromise<void>Append a pane (default at the bottom).
id: stringPromise<void>Remove a pane by id (the last pane stays).
id: string, to: numberPromise<void>Move a pane to a new stack position.
id: string, weight: numberPromise<void>Set a pane's weight directly.
count?: numberPromise<number>Pull older bars through `historyLoader` and keep the view anchored. chart.stock: when the grant ends (or changes) while the loader runs, nothing merges into the frozen tape and the call rejects with the §4.1 `stale` refusal. The licenseFeatureRefused event (code `stale`, method `loadOlderHistory`) is dispatched FIRST; the request then still ends with `historyLoaded { added: 0, exhausted: false }` so a loading state the app shows for historyRequested clears.
range: StockRangeKeyPromise<{ from: number; to: number }>Apply a range button: window the CURRENT tape by calendar maths.
resolution: StockResolutionPromise<void>Switch the tape resolution (resets the window — indices change).