# chart-combination-chart

> Multi-series combination chart with spline area and column series with strip lines.

**Framework:** vue  **Component:** Chart  **Variant:** combination-chart

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/vue/chart-combination-chart.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-vue-charts
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/chart-combination-chart/CombinationChart.vue

```vue
<template>
    <div class="business-performance">
        <div class="business-chart-title">
            Business Revenue, Profit and Order Performance
        </div>

        <div class="business-chart-subtitle">
            Monthly performance analysis | January – June 2024
        </div>

        <ejs-chart id="business-performance-chart" height="500px" width="100%" background="transparent"
            :primaryXAxis="primaryXAxis" :primaryYAxis="primaryYAxis"
            :tooltip="tooltip" :crosshair="crosshair" :legendSettings="legendSettings"
            :chartArea="chartArea" :legendRender="handleLegendRender">
            <e-axes>
                <e-axis name="ordersAxis" :opposedPosition="true" :minimum="0" :maximum="600" :interval="100"
                    title="Orders (Count)" :majorGridLines="zeroLine" :majorTickLines="zeroLine"
                    :lineStyle="zeroLine"></e-axis>
            </e-axes>

            <e-series-collection>
                <!-- Revenue - Spline -->
                <e-series :dataSource="businessData" xName="month" yName="revenue" name="Revenue" type="Spline"
                    :width="2.5" fill="#1683ed" :marker="revenueMarker"></e-series>

                <!-- Profit - Spline Area -->
                <e-series :dataSource="businessData" xName="month" yName="profit" name="Profit" type="SplineArea"
                    :width="2" fill="#16a765" :opacity="0.20" :border="profitBorder"
                    :marker="profitMarker"></e-series>

                <!-- Orders - Column -->
                <e-series :dataSource="businessData" xName="month" yName="orders" name="Orders" type="Column"
                    yAxisName="ordersAxis" fill="#9747ff" :columnWidth="0.5" :columnSpacing="0.2"></e-series>
            </e-series-collection>
        </ejs-chart>

        <div style="text-align: center; color: #64748b; font-size: 11px; margin-top: 4px;">
            April represents the promotional campaign period.
            The orange strip line indicates the $80K revenue target.
        </div>
    </div>
</template>

<script setup lang="ts">
import { provide } from 'vue';
import {
    ChartComponent as EjsChart,
    SeriesCollectionDirective as ESeriesCollection,
    SeriesDirective as ESeries,
    AxesDirective as EAxes,
    AxisDirective as EAxis,
    Category,
    SplineSeries,
    SplineAreaSeries,
    ColumnSeries,
    Legend,
    Tooltip,
    Crosshair,
    StripLine,
    DataLabel,
    type AxisModel,
    type LegendSettingsModel,
    type MarkerSettingsModel,
    type TooltipSettingsModel,
    type CrosshairSettingsModel,
    type ChartAreaModel,
    type BorderModel,
    type ILegendRenderEventArgs
} from '@syncfusion/ej2-vue-charts';

provide('chart', [Category, SplineSeries, SplineAreaSeries, ColumnSeries, Legend, Tooltip, Crosshair, StripLine, DataLabel]);

interface BusinessData {
    month: string;
    revenue: number;
    profit: number;
    orders: number;
    revenueLabel: string;
    profitLabel: string;
}

const businessData: BusinessData[] = [
    { month: 'Jan', revenue: 65000, profit: 18000, orders: 240, revenueLabel: '$65K', profitLabel: '$18K' },
    { month: 'Feb', revenue: 72000, profit: 22000, orders: 270, revenueLabel: '$72K', profitLabel: '$22K' },
    { month: 'Mar', revenue: 81000, profit: 25000, orders: 340, revenueLabel: '$81K', profitLabel: '$25K' },
    { month: 'Apr', revenue: 76000, profit: 21000, orders: 310, revenueLabel: '$76K', profitLabel: '$21K' },
    { month: 'May', revenue: 94000, profit: 31000, orders: 390, revenueLabel: '$94K', profitLabel: '$31K' },
    { month: 'Jun', revenue: 102000, profit: 34000, orders: 420, revenueLabel: '$102K', profitLabel: '$34K' }
];

// Custom legend template.
// Avoid fixed widths so the legend layout can calculate item spacing naturally.
const legendTemplate: string =
    '<div style="display:inline-flex;align-items:center;gap:12px;padding:10px 16px;min-height:68px;box-sizing:border-box;border:1px solid #e2e8f0;border-radius:10px;background:#ffffff;white-space:nowrap;cursor:pointer;">' +
        '<span style="display:flex;align-items:center;justify-content:center;min-width:28px;font-size:25px;font-weight:600;color:{{color}};">{{icon}}</span>' +
        '<div style="display:flex;flex-direction:column;gap:3px;">' +
            '<span style="font-size:16px;font-weight:600;color:#1e293b;">{{title}}</span>' +
            '<span style="font-size:12px;color:#64748b;">{{description}}</span>' +
        '</div>' +
    '</div>';

const legendSettings: LegendSettingsModel = {
    visible: true,
    position: 'Top',
    alignment: 'Center',
    layout: 'Horizontal',
    width: '100%',
    height: '95px',
    itemPadding: 15,
    enablePages: false,
    template: legendTemplate
};

// Customize legend content for each series.
const handleLegendRender = (args: ILegendRenderEventArgs): void => {
    const legendDetails: Record<string, { icon: string; description: string }> = {
        Revenue: { icon: '↗', description: '($ in Thousands)' },
        Profit: { icon: '⌁', description: '($ in Thousands)' },
        Orders: { icon: '▮', description: '(Count)' }
    };

    const details: { icon: string; description: string } = legendDetails[args.text];

    if (!details) {
        return;
    }

    args.template = legendTemplate
        .replace('{{color}}', args.fill)
        .replace('{{icon}}', details.icon)
        .replace('{{title}}', args.text)
        .replace('{{description}}', details.description);
};

// X-axis with April promotional campaign strip line.
const primaryXAxis: AxisModel = {
    valueType: 'Category',
    majorGridLines: { width: 0 },
    majorTickLines: { width: 0 },
    lineStyle: { color: '#cbd5e1', width: 1 },
    labelStyle: { color: '#64748b', size: '12px' },
    stripLines: [
        {
            start: 3,
            end: 4,
            color: '#a855f7',
            opacity: 0.14,
            visible: true,
            text: 'April Promotion',
            horizontalAlignment: 'Middle',
            verticalAlignment: 'Middle',
            rotation: -90,
            zIndex: 'Behind',
            textStyle: { color: '#7e22ce', size: '11px', fontWeight: '600' }
        }
    ]
};

// Primary Y-axis with $80K revenue target.
const primaryYAxis: AxisModel = {
    minimum: 0,
    maximum: 120000,
    interval: 20000,
    title: 'Amount ($ in Thousands)',
    labelFormat: '${value}',
    majorGridLines: { width: 1, color: '#e2e8f0', dashArray: '3,3' },
    majorTickLines: { width: 0 },
    lineStyle: { width: 0 },
    labelStyle: { color: '#64748b', size: '11px' },
    stripLines: [
        {
            start: 80000,
            end: 80500,
            color: '#f59e0b',
            opacity: 0.12,
            visible: true,
            text: 'Revenue Target: $80K',
            horizontalAlignment: 'End',
            verticalAlignment: 'Start',
            rotation: 0,
            zIndex: 'Over',
            textStyle: { color: '#b45309', size: '11px', fontWeight: '600' },
            border: { color: '#f59e0b', width: 1 }
        }
    ]
};

const tooltip: TooltipSettingsModel = { enable: true, shared: true };

const crosshair: CrosshairSettingsModel = {
    enable: true,
    lineType: 'Vertical',
    line: { color: '#94a3b8', width: 1, dashArray: '4,4' }
};

const chartArea: ChartAreaModel = { border: { width: 0 } };

const zeroLine: { width: number } = { width: 0 };

// Revenue data labels: name maps revenueLabel to point.text.
const revenueMarker: MarkerSettingsModel = {
    visible: true,
    width: 7,
    height: 7,
    shape: 'Circle',
    fill: '#ffffff',
    border: { color: '#1683ed', width: 2 },
    dataLabel: {
        visible: true,
        name: 'revenueLabel',
        template:
            '<div style="padding:4px 7px;border:1px solid #1683ed;border-radius:5px;background:#ffffff;color:#1683ed;font-size:11px;font-weight:600;white-space:nowrap;">${point.text}</div>',
        position: 'Top'
    }
};

// Profit markers.
const profitMarker: MarkerSettingsModel = {
    visible: true,
    width: 6,
    height: 6,
    shape: 'Circle',
    fill: '#ffffff',
    border: { color: '#16a765', width: 2 }
};

const profitBorder: BorderModel = { color: '#16a765', width: 2 };
</script>

<style>
.business-performance {
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: Arial, sans-serif;
}

.business-chart-title {
    text-align: center;
    color: #1e293b;
    font-size: 24px;
    font-weight: 600;
    margin: 8px 0 4px;
}

.business-chart-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 4px;
}

.business-performance .e-legend-item {
    cursor: pointer;
}

.business-performance .e-legend-item:hover {
    opacity: 0.88;
}

@media (max-width: 850px) {
    .business-chart-title {
        font-size: 20px;
    }

    .business-performance .e-legend {
        height: auto !important;
    }
}

@media (max-width: 600px) {
    .business-performance {
        padding: 8px;
    }

    .business-chart-title {
        font-size: 18px;
    }

    .business-chart-subtitle {
        font-size: 12px;
    }
}
</style>

```
