{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "chart-financial",
  "framework": "vue",
  "type": "registry:component",
  "component": "Chart",
  "variant": "financial",
  "dependencies": [
    "@syncfusion/ej2-vue-charts"
  ],
  "description": "Financial chart with switchable candlestick, Hilo series, and time range filtering.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/vue/llms.txt",
    "skillPack": "syncfusion/vue-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/vue/chart-financial.md"
  },
  "files": [
    {
      "target": "src/components/chart-financial/Financial.vue",
      "content": "<template>\n    <div class=\"stock-market-sample\">\n        <div class=\"stock-market-header\">\n            <h2>Acme Inc. Stock Market Analysis</h2>\n            <p>Historical stock price and trading volume</p>\n        </div>\n\n        <div class=\"stock-market-toolbar\">\n            <select class=\"stock-market-series-select\" v-model=\"seriesType\" aria-label=\"Select series type\">\n                <option v-for=\"option in seriesOptions\" :key=\"option\" :value=\"option\">\n                    {{ option === 'HiloOpenClose' ? 'Hilo Open/Close' : option }}\n                </option>\n            </select>\n\n            <div class=\"stock-market-periods\" role=\"group\" aria-label=\"Select period range\">\n                <button v-for=\"period in periods\" :key=\"period\" type=\"button\"\n                    :class=\"['stock-market-period-button', { active: selectedPeriod === period }]\"\n                    :aria-pressed=\"selectedPeriod === period\"\n                    @click=\"selectedPeriod = period\">\n                    {{ period }}\n                </button>\n            </div>\n        </div>\n\n        <div class=\"stock-market-chart\">\n            <ejs-chart id=\"stock-market-analysis\" height=\"450px\" title=\"\" background=\"transparent\"\n                :primaryXAxis=\"primaryXAxis\" :primaryYAxis=\"primaryYAxis\"\n                :tooltip=\"tooltip\" :crosshair=\"crosshair\" :legendSettings=\"legendSettings\">\n                <e-axes>\n                    <e-axis name=\"volumeYAxis\" :opposedPosition=\"false\" :minimum=\"0\" :maximum=\"volumeMaximum * 5\"\n                        :majorGridLines=\"zeroLine\" :lineStyle=\"zeroLine\" :majorTickLines=\"zeroLine\"\n                        :labelStyle=\"transparentLabel\"></e-axis>\n                </e-axes>\n\n                <e-series-collection>\n                    <e-series :dataSource=\"visibleData\" xName=\"date\" name=\"Stock Price\" :type=\"seriesType\"\n                        low=\"low\" high=\"high\" open=\"open\" close=\"close\" yName=\"close\"\n                        :bullFillColor=\"bullColor\" :bearFillColor=\"bearColor\" :enableTooltip=\"true\"\n                        :animation=\"animation\" :opacity=\"seriesType === 'Candle' ? 0.8 : 1\" :width=\"2\"></e-series>\n\n                    <e-series :dataSource=\"visibleData\" xName=\"date\" yName=\"volume\" name=\"Volume\" type=\"Column\"\n                        yAxisName=\"volumeYAxis\" fill=\"#90A4AE\" :opacity=\"0.3\" :enableTooltip=\"false\"\n                        :animation=\"animation\"></e-series>\n                </e-series-collection>\n            </ejs-chart>\n        </div>\n    </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, provide, ref } from 'vue';\nimport {\n    ChartComponent as EjsChart,\n    SeriesCollectionDirective as ESeriesCollection,\n    SeriesDirective as ESeries,\n    AxesDirective as EAxes,\n    AxisDirective as EAxis,\n    DateTime,\n    CandleSeries,\n    LineSeries,\n    HiloSeries,\n    HiloOpenCloseSeries,\n    StepLineSeries,\n    ColumnSeries,\n    Tooltip,\n    Crosshair,\n    Legend,\n    StripLine,\n    type AxisModel,\n    type StripLineSettingsModel,\n    type TooltipSettingsModel,\n    type CrosshairSettingsModel,\n    type LegendSettingsModel,\n    type AnimationModel\n} from '@syncfusion/ej2-vue-charts';\nimport { stockData1Completed } from '../datasource/chart-data';\n\nprovide('chart', [DateTime, CandleSeries, LineSeries, HiloSeries, HiloOpenCloseSeries, StepLineSeries, ColumnSeries, Tooltip, Crosshair, Legend, StripLine]);\n\ntype SeriesType = 'Candle' | 'Line' | 'Hilo' | 'HiloOpenClose' | 'StepLine';\n\ntype RangeType = '1M' | '3M' | '6M' | 'YTD' | '1Y' | 'All';\n\ninterface StockData {\n    date: Date;\n    open: number;\n    high: number;\n    low: number;\n    close: number;\n    volume: number;\n}\n\ninterface DateRange {\n    minimum: Date;\n    maximum: Date;\n}\n\nconst periods: RangeType[] = ['1M', '3M', '6M', 'YTD', '1Y', 'All'];\n\nconst seriesOptions: SeriesType[] = ['Candle', 'Line', 'Hilo', 'HiloOpenClose', 'StepLine'];\n\nconst seriesType = ref<SeriesType>('Candle');\nconst selectedPeriod = ref<RangeType>('All');\n\nconst bullColor: string = '#43A047';\nconst bearColor: string = '#E53935';\n\nconst allData: StockData[] = stockData1Completed\n    .map((item: StockData) => ({ ...item, date: new Date(item.date) }))\n    .sort((a: StockData, b: StockData) => a.date.getTime() - b.date.getTime());\n\nconst minDate: Date = allData.length ? allData[0].date : new Date();\nconst maxDate: Date = allData.length ? allData[allData.length - 1].date : new Date();\n\nconst axisRange = computed<DateRange>(() => {\n    const end: Date = new Date(maxDate.getTime());\n    const start: Date = new Date(end.getTime());\n\n    switch (selectedPeriod.value) {\n        case '1M':\n            start.setMonth(end.getMonth() - 1);\n            break;\n        case '3M':\n            start.setMonth(end.getMonth() - 3);\n            break;\n        case '6M':\n            start.setMonth(end.getMonth() - 6);\n            break;\n        case 'YTD':\n            start.setMonth(0, 1);\n            start.setHours(0, 0, 0, 0);\n            break;\n        case '1Y':\n            start.setFullYear(end.getFullYear() - 1);\n            break;\n        case 'All':\n            return { minimum: minDate, maximum: maxDate };\n    }\n\n    return { minimum: start, maximum: end };\n});\n\nconst visibleData = computed<StockData[]>(() =>\n    allData.filter(\n        (item: StockData) => item.date >= axisRange.value.minimum && item.date <= axisRange.value.maximum\n    )\n);\n\nconst priceRange = computed<{ minimum: number; maximum: number }>(() => {\n    const lows: number[] = visibleData.value.map((item: StockData) => item.low);\n    const highs: number[] = visibleData.value.map((item: StockData) => item.high);\n\n    const minimum: number = Math.min(...lows);\n    const maximum: number = Math.max(...highs);\n    const padding: number = Math.max(1, (maximum - minimum) * 0.02);\n\n    return {\n        minimum: Math.floor((minimum - padding) / 20) * 20,\n        maximum: Math.ceil((maximum + padding) / 20) * 20\n    };\n});\n\nconst volumeMaximum = computed<number>(() =>\n    Math.max(...visibleData.value.map((item: StockData) => item.volume), 1)\n);\n\nconst primaryXAxis = computed<AxisModel>(() => {\n    const isShortPeriod: boolean = selectedPeriod.value === '1M' || selectedPeriod.value === '3M';\n\n    return {\n        valueType: 'DateTime',\n        minimum: axisRange.value.minimum,\n        maximum: axisRange.value.maximum,\n        labelFormat: isShortPeriod ? 'd MMM' : 'MMM yyyy',\n        intervalType: isShortPeriod ? 'Days' : 'Months',\n        edgeLabelPlacement: 'Shift',\n        majorGridLines: { width: 0 },\n        crosshairTooltip: { enable: true }\n    };\n});\n\nconst primaryYAxis = computed<AxisModel>(() => {\n    const resistance: number = Math.max(...visibleData.value.map((item: StockData) => item.high));\n    const support: number = Math.min(...visibleData.value.map((item: StockData) => item.low));\n\n    const stripLines: StripLineSettingsModel[] = selectedPeriod.value === 'All'\n        ? [\n            { start: support, end: support + 0.1, text: 'Support', color: '#43A047', visible: true, opacity: 0.8, dashArray: '3,3' },\n            { start: resistance - 0.1, end: resistance, text: 'Resistance', color: '#E53935', visible: true, opacity: 0.8, dashArray: '3,3' }\n        ]\n        : [];\n\n    return {\n        minimum: priceRange.value.minimum,\n        maximum: priceRange.value.maximum,\n        opposedPosition: true,\n        labelFormat: 'n2',\n        majorGridLines: { width: 1, color: '#eeeeee' },\n        crosshairTooltip: { enable: true },\n        stripLines: stripLines\n    };\n});\n\nconst tooltip: TooltipSettingsModel = {\n    enable: true,\n    shared: true,\n    enableMarker: false, // React sample used 'showMarker', which is not a TooltipSettings property\n    format: '${series.name}: ${point.y}'\n};\n\nconst crosshair: CrosshairSettingsModel = { enable: true, dashArray: '3,3', lineType: 'Both' };\n\nconst legendSettings: LegendSettingsModel = { visible: false };\n\nconst animation: AnimationModel = { enable: false };\n\nconst zeroLine: { width: number } = { width: 0 };\n\nconst transparentLabel: { color: string } = { color: 'transparent' };\n</script>\n\n<style>\n.stock-market-sample {\n    box-sizing: border-box;\n    width: 100%;\n    height: calc(100vh - 105px);\n    min-height: 520px;\n    padding: 20px 24px 24px;\n    overflow-y: auto;\n    overflow-x: hidden;\n    background: #f8fafc;\n    scrollbar-gutter: stable;\n}\n\n.stock-market-header {\n    text-align: center;\n    margin: 2px 0 20px;\n}\n\n.stock-market-header h2 {\n    margin: 0 0 6px;\n    color: #172554;\n    font-size: 25px;\n    line-height: 1.3;\n    font-weight: 650;\n}\n\n.stock-market-header p {\n    margin: 0;\n    color: #64748b;\n    font-size: 14px;\n}\n\n.stock-market-toolbar {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    flex-wrap: wrap;\n    gap: 12px 16px;\n    width: 100%;\n    min-width: 0;\n    margin: 0 0 14px;\n}\n\n.stock-market-series-select {\n    box-sizing: border-box;\n    min-width: 155px;\n    height: 38px;\n    padding: 0 12px;\n    border: 1px solid #cbd5e1;\n    border-radius: 7px;\n    background: #fff;\n    color: #334155;\n    font-size: 14px;\n    outline: none;\n}\n\n.stock-market-series-select:focus-visible,\n.stock-market-period-button:focus-visible {\n    outline: 2px solid #38bdf8;\n    outline-offset: 2px;\n}\n\n.stock-market-periods {\n    display: flex;\n    align-items: center;\n    justify-content: flex-end;\n    flex-wrap: wrap;\n    gap: 7px;\n    min-width: 0;\n    max-width: 100%;\n}\n\n.stock-market-period-button {\n    flex: 0 0 auto;\n    min-width: 49px;\n    height: 36px;\n    padding: 0 13px;\n    border: 1px solid #dbe2ea;\n    border-radius: 7px;\n    background: #fff;\n    color: #475569;\n    font-size: 13px;\n    font-weight: 500;\n    cursor: pointer;\n    transition: background-color .15s ease, color .15s ease,\n                border-color .15s ease, box-shadow .15s ease;\n}\n\n.stock-market-period-button:hover {\n    border-color: #7dd3fc;\n    background: #f0f9ff;\n}\n\n.stock-market-period-button.active {\n    border-color: #0284c7;\n    background: #0284c7;\n    color: #fff;\n    box-shadow: 0 1px 3px rgba(2, 132, 199, .2);\n}\n\n.stock-market-chart {\n    width: 100%;\n    min-width: 0;\n    height: 470px;\n    padding: 8px 10px 4px;\n    box-sizing: border-box;\n    border: 1px solid #e2e8f0;\n    border-radius: 10px;\n    background: #fff;\n    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);\n}\n\n.stock-market-chart .e-chart {\n    width: 100% !important;\n}\n\n@media (max-width: 900px) {\n    .stock-market-sample {\n        padding: 16px;\n    }\n\n    .stock-market-toolbar {\n        align-items: flex-start;\n        flex-direction: column;\n    }\n\n    .stock-market-periods {\n        justify-content: flex-start;\n    }\n}\n\n@media (max-width: 600px) {\n    .stock-market-sample {\n        height: calc(100vh - 90px);\n        min-height: 480px;\n        padding: 12px;\n    }\n\n    .stock-market-header h2 {\n        font-size: 21px;\n    }\n\n    .stock-market-chart {\n        height: 400px;\n        padding: 4px;\n    }\n\n    .stock-market-periods {\n        width: 100%;\n        justify-content: flex-start;\n    }\n}\n</style>\n"
    }
  ]
}