external/ag-shared/prompts/skills/example/ag-charts/features/enterprise.md
Enterprise features require import { AgCharts } from 'ag-charts-enterprise' and a valid license.
Apply: 8 minutes, Impact: MEDIUM β RECOMMENDED for data-heavy charts
axes: {
y: {
type: 'number', // Required field
position: 'left',
crosshair: {
enabled: true,
label: {
enabled: true,
// Don't set color - theme handles it
},
},
},
x: {
type: 'category', // Required field
position: 'bottom',
crosshair: {
enabled: true,
},
},
};
crosshair: {
enabled: true,
snap: true, // Snap to data points
strokeWidth: 1,
lineDash: [5, 5],
label: {
enabled: true,
xOffset: 5,
yOffset: -5,
renderer: (params) => ({
text: formatValue(params.value),
// Don't set color/backgroundColor - theme handles it
opacity: 0.9,
}),
},
}
Apply: 5 minutes, Impact: HIGH for large datasets β ESSENTIAL for time series
zoom: {
enabled: true,
enableAxisDragging: true, // Drag on axes to zoom
enablePanning: true, // Pan after zooming
enableSelecting: true, // Box selection zoom
}
zoom: {
enabled: true,
enableSelecting: true,
keepAspectRatio: true, // Maintain chart proportions
panKey: 'shift', // Hold shift to pan
axes: 'x', // Restrict to x-axis only
}
Apply: 8 minutes, Impact: VERY HIGH for time series ββ MANDATORY for long time series
navigator: {
enabled: true,
height: 60,
miniChart: {
enabled: true,
series: [
{
type: 'area',
xKey: 'date',
yKey: 'value',
// Don't set fill/stroke - theme handles it
fillOpacity: 0.3,
},
],
},
mask: {
// Don't set fill - theme handles mask colors
fillOpacity: 0.1,
},
min: 0.3, // Default visible range (30%)
max: 0.7, // Default visible range (70%)
}
Apply: 10 minutes, Impact: VERY HIGH for financial data ββ USE FOR ALL FINANCIAL DATA
import { AgCharts } from 'ag-charts-enterprise';
// Use specialized API for financial charts
const chart = AgCharts.createFinancialChart({
container: document.getElementById('myChart'),
data: stockData,
chartType: 'candlestick', // 'hollow-candlestick', 'ohlc', 'line'
dateKey: 'date',
openKey: 'open',
highKey: 'high',
lowKey: 'low',
closeKey: 'close',
volumeKey: 'volume',
// Built-in features
navigator: true, // Time range selection
ranges: {
buttons: [
'1W',
'1M',
{ type: 'fixed', count: 90, label: '90D' },
{ type: 'callback', label: 'YTD', callback: ({ setRange }) => setRange('yearToDate') },
],
},
statusBar: true, // Shows OHLC values
volume: true, // Volume chart below main chart
// Professional styling
theme: 'ag-financial-dark', // or 'ag-financial'
// β
Note: Financial charts automatically position price axis on right (industry standard)
});
Tip: Tailor ranges.buttons to match analyst workflows (earnings windows, YTD, custom callbacks) instead of relying on the default presets.
Apply: 20 minutes, Impact: HIGH for analysis β POWERFUL for technical analysis
annotations: {
enabled: true,
initial: [], // Pre-configured annotations
toolbar: {
enabled: true,
position: 'top',
buttons: [
'line',
'horizontal-line',
'vertical-line',
'parallel-channel',
'text',
'shape',
'measure',
'fibonacci-retracement',
'trend-line',
],
},
}
annotations: {
enabled: true, // Make annotations visible.
toolbar: {
enabled: false, // Don't show UI buttons for adding more annotations.
},
},
initialState: {
annotations: [
{
type: 'line',
xStart: 'Q1 2024',
yStart: 100000,
xEnd: 'Q4 2024',
yEnd: 150000,
text: {
label: 'Growth Trend',
position: 'center',
},
strokeWidth: 2,
lineDash: [8, 4],
locked: true, // Don't allow editing of this annotation.
},
{
type: 'text',
x: 'Q2 2024',
y: 120000,
text: 'Product Launch',
// Don't set color - theme handles it
locked: true, // Don't allow editing of this annotation.
},
],
}
Apply: 15 minutes, Impact: VERY HIGH for regional data ββ IMPRESSIVE for executive dashboards
import { worldMapData } from './map-data';
// Your topology data
series: [
{
type: 'map-shape',
topology: worldMapData,
idKey: 'countryCode',
idName: 'countryName',
// Data binding
data: salesByCountry,
colorKey: 'revenue',
colorRange: ['lightblue', 'darkblue'], // Semantic colors
colorName: 'Revenue',
// Interactivity
highlight: {
highlightItem: {
item: {
strokeWidth: 2,
},
},
},
// Labels
label: {
enabled: true,
// Don't set fontSize or color
},
// Tooltips
tooltip: {
renderer: (params) => ({
title: params.datum.countryName,
data: [
{ label: 'Revenue', value: `$${params.datum.revenue.toLocaleString()}` },
{ label: 'Growth', value: `${params.datum.growth}%` },
],
}),
},
},
];
Apply: 7 minutes, Impact: HIGH for dashboards β ESSENTIAL for multi-chart dashboards
// Chart 1 - Main metrics
const chart1 = AgCharts.create({
// ... chart config
sync: {
enabled: true,
groupId: 'dashboard-metrics',
axes: 'x', // Sync x-axis
nodeInteraction: true, // Sync hover
zoom: true, // Sync zoom/pan
},
});
// Chart 2 - Secondary metrics (automatically synced)
const chart2 = AgCharts.create({
// ... chart config
sync: {
enabled: true,
groupId: 'dashboard-metrics', // Same group
},
});
Apply: 6 minutes, Impact: HIGH for scientific data β PROFESSIONAL for research data
series: [
{
type: 'line',
xKey: 'x',
yKey: 'y',
yName: 'Measurement',
errorBar: {
visible: true,
yLowerKey: 'yMin', // Lower bound
yUpperKey: 'yMax', // Upper bound
// Can also use symmetric errors
// yErrorKey: 'yError', // Β± error value
strokeWidth: 1,
// Don't set stroke - theme handles it
cap: {
visible: true,
length: 6,
lengthRatio: 0.3, // Relative to marker size
strokeWidth: 1,
},
// Whiskers (lines connecting caps)
whisker: {
strokeWidth: 1,
lineDash: [2, 2],
},
},
},
];
Apply: 10 minutes, Impact: HIGH for KPIs β PERFECT for executive KPIs
import { AgCharts } from 'ag-charts-enterprise';
const gauge = AgCharts.createGauge({
container: document.getElementById('myChart'),
type: 'radial-gauge',
value: 75,
min: 0,
max: 100,
// Visual configuration
startAngle: -90,
endAngle: 90,
// Bands for ranges
bands: [
{ from: 0, to: 50, color: 'red', label: 'Poor' },
{ from: 50, to: 80, color: 'yellow', label: 'Good' },
{ from: 80, to: 100, color: 'green', label: 'Excellent' },
],
// Needle configuration
needle: {
enabled: true,
strokeWidth: 2,
length: 0.8, // 80% of radius
},
// Labels
label: {
enabled: true,
formatter: (params) => `${params.value}%`,
},
// Center text
innerText: [{ text: 'Performance' }, { text: '75%' }],
});
Apply: 12 minutes, Impact: VERY HIGH for flow visualization ββ EXCELLENT for process flows
series: [
{
type: 'sankey',
sort: 'descending',
fromKey: 'source',
toKey: 'target',
sizeKey: 'value',
// Node configuration
node: {
width: 20,
spacing: 30,
minSpacing: 12,
alignment: 'justify', // 'left', 'right', 'center', 'justify'
verticalAlignment: 'center',
label: {
enabled: true,
placement: 'right',
edgePlacement: 'outside',
// Don't set fontSize or color
},
},
// Link configuration
link: {
// Don't set fill - theme handles gradient colors
fillOpacity: 0.5,
highlight: {
highlightItem: {
item: {
fillOpacity: 0.8,
strokeWidth: 1,
},
},
},
itemStyler: ({ size }) => (size > 1_000 ? { strokeWidth: 2 } : {}),
},
// Tooltips
tooltip: {
renderer: (params) => {
if (params.type === 'node') {
return {
title: params.datum.id,
data: [{ label: 'Total', value: params.datum.value }],
};
} else {
return {
title: `${params.datum.source} β ${params.datum.target}`,
data: [{ label: 'Flow', value: params.datum.value }],
};
}
},
},
},
];
All features in this module require:
import { AgCharts } from 'ag-charts-enterprise';
// License key must be set before creating charts
AgCharts.setLicenseKey('your-license-key');
Without a valid license, these features will display a watermark or may not function.