The Complete Production SOP: How to Deploy and Run Apache ECharts Enterprise Visualizations in Autonomous AI Agents
Step-by-step SOP to install and run Apache ECharts Enterprise Visualizations in Codex, Claude Code, and Cursor. Includes verified prompts and troubleshooting.
Technical Overview & Architectural Context
Autonomous coding agents frequently stumble when generating complex Apache ECharts visual components in enterprise dashboards. Standard LLMs often fail to handle container lifecycle events, omit resize listeners, misconfigure multidimensional dataZoom index arrays, or choose the memory-intensive Canvas renderer over SVG when rendering dense DOM structures. Furthermore, models frequently hallucinate non-existent ECharts v5 API methods or mutate option payloads in-place without triggering reactive UI updates, leading to silent rendering failures. The 'echarts-enterprise-data-dashboard' skill enforces deterministic boundaries across Codex, Claude Code, Cursor, and Windsurf. By establishing strict procedural protocols around initialization (handling renderer selection flags), comprehensive option declaration (specifying explicit coordinate systems and axes types), and strict clean-up teardowns, this skill guarantees that AI coding assistants emit performant, memory-leak-free, and responsive visualization logic every single time.
Prerequisites & Environment Requirements
Verified Search Intents & Long-Tail Queries Solved
This operational tutorial is engineered to provide deterministic solutions for these developer search queries:
Step-by-Step Execution Playbook
Local Environment Setup & SKILL.md Mounting
Create the local skill manifest directory and inject verified procedural rules into your workspace.
Autonomous agent runtimes such as Claude Code, Cursor, and Windsurf parse skills located in workspace-level metadata directories. By mounting the verified SKILL.md under '.agents/skills/echarts-enterprise-data-dashboard', the agent runtime parses the YAML frontmatter triggers and loads the visualization procedural rules directly into its execution plan whenever chart generation tasks are requested.
mkdir -p .agents/skills/echarts-enterprise-data-dashboard && cat << 'EOF' > .agents/skills/echarts-enterprise-data-dashboard/SKILL.md
---
name: "echarts-enterprise-data-dashboard"
description: "Render complex multi-dimensional enterprise charts and maps with Apache ECharts."
metadata:
author: "Apache"
version: "1.0.0"
runtime_compatibility:
- "codex"
- "claude-code"
- "cursor"
- "windsurf"
triggers:
- "create candlestick chart echarts"
- "add datazoom slider echarts"
- "switch echarts to svg renderer"
permissions:
fs_read: true
fs_write: "workspace"
shell_exec: false
net_access: false
---
# Apache ECharts Enterprise Visualizations SOP
1. Initialize instances with echarts.init(dom, null, { renderer: 'canvas' | 'svg' }).
2. Define complete configuration objects and apply via chartInstance.setOption(option, true).
3. Enable dataZoom components: [{ type: 'slider', start: 0, end: 100 }] for large time-series data.
4. Attach a ResizeObserver or window resize listener executing chartInstance.resize() with debouncing.
5. Always invoke chartInstance.dispose() during component unmount cycles to prevent memory leaks.
EOF---
name: "echarts-enterprise-data-dashboard"
description: "Render complex multi-dimensional enterprise charts and maps with Apache ECharts."
metadata:
author: "Apache"
version: "1.0.0"
runtime_compatibility:
- "codex"
- "claude-code"
- "cursor"
- "windsurf"
triggers:
- "create candlestick chart echarts"
- "add datazoom slider echarts"
- "switch echarts to svg renderer"
permissions:
fs_read: true
fs_write: "workspace"
shell_exec: false
net_access: false
---Keep the SKILL.md strictly confined to structural rules and API signatures; avoiding verbose descriptive prose saves over 350 context tokens per agent invocation.
Ensure that fs_write is constrained to 'workspace'. Attempting to allow global file writes or shell execution will drop the security audit score below enterprise clearance.
Dependency & Tree-Shaking Validation
Ensure required ECharts modules and renderer components are installed and tree-shakeable.
To prevent excessive bundle bloat, verify that the project imports granular chart types and renderer components from 'echarts/core'. Claude Code and Codex will run lint checks against module boundaries. Install the required packages without injecting unnecessary third-party wrapper libraries.
npm install echarts@^5.5.0 && npm install -D @types/echartsimport * as echarts from 'echarts/core';
import { CandlestickChart, BarChart } from 'echarts/charts';
import {
TooltipComponent,
GridComponent,
DataZoomComponent
} from 'echarts/components';
import { CanvasRenderer, SVGRenderer } from 'echarts/renderers';
echarts.use([
CandlestickChart,
BarChart,
TooltipComponent,
GridComponent,
DataZoomComponent,
CanvasRenderer,
SVGRenderer
]);
export { echarts };Encourage the agent to use granular 'echarts/core' imports rather than 'import * as echarts from echarts' to keep production client bundles up to 60% lighter.
Omitting the explicit registration of DataZoomComponent with echarts.use() will cause runtime option drops without throwing compile-time TypeScript errors.
Intent Matching & Trigger Invocation
Verify deterministic activation using tested natural language prompts.
Instruct the coding agent using exact trigger keywords defined in the manifest. When you prompt the agent with phrases such as 'create candlestick chart echarts' or 'add datazoom slider echarts', the agent engine pattern-matches the trigger, reads the SOP rules, and implements the robust ECharts boilerplate including resize observers.
# Claude Code CLI execution
claude "create candlestick chart echarts with responsive resize and add datazoom slider echarts for daily OHLC data in src/components/StockChart.tsx"Combine multiple trigger strings directly in your user prompt to invoke multidimensional logic (e.g., both candlestick series and datazoom sliders) in a single pass.
Do not pass raw CSV datasets into the agent prompt. Provide a TypeScript interface and mock schema to avoid exhausting the LLM's context window.
Verification, Linting & Output Quality Gate
Execute automated self-healing checks and type audits before accepting agent deliverables.
The skill mandates that the agent verify TypeScript compilation and unmount disposal before concluding the task. Run the project build or typecheck suite to validate that chart options align strictly with echarts.EChartsOption typings.
npx tsc --noEmit && npm run lintimport React, { useEffect, useRef } from 'react';
import { echarts } from '../charts/financialChart';
import type { ECharts, EChartsCoreOption } from 'echarts/core';
interface Props {
data: Array<[string, number, number, number, number]>; // [Date, Open, Close, Lowest, Highest]
}
export const StockChart: React.FC<Props> = ({ data }) => {
const containerRef = useRef<HTMLDivElement>(null);
const instanceRef = useRef<ECharts | null>(null);
useEffect(() => {
if (!containerRef.current) return;
const chart = echarts.init(containerRef.current, null, { renderer: 'canvas' });
instanceRef.current = chart;
const option: EChartsCoreOption = {
xAxis: { type: 'category', data: data.map(item => item[0]) },
yAxis: { scale: true },
series: [{
type: 'candlestick',
data: data.map(item => [item[1], item[2], item[3], item[4]])
}],
dataZoom: [
{ type: 'inside', start: 50, end: 100 },
{ type: 'slider', start: 50, end: 100 }
]
};
chart.setOption(option);
const resizeObserver = new ResizeObserver(() => chart.resize());
resizeObserver.observe(containerRef.current);
return () => {
resizeObserver.disconnect();
chart.dispose();
};
}, [data]);
return <div ref={containerRef} style={{ width: '100%', height: '450px' }} />;
};Ensure the agent attaches ResizeObserver to the container element rather than just window.onresize, guaranteeing chart adaptability inside dynamic CSS Grid dashboard layouts.
Watch out for React 18 StrictMode: mounting twice will leak un-disposed instances if chartInstance.dispose() is omitted in the cleanup return callback.
Real-World Scenario: High-Frequency Financial Dashboard with OHLC Candlestick and DataZoom Slider
“create candlestick chart echarts component in React TypeScript. Include volume histogram on a secondary grid, add datazoom slider echarts at the bottom, and switch echarts to svg renderer if mobile viewport is detected.”
Runtime Troubleshooting & Failure Modes
Root Cause: The agent attempted to execute echarts.init() before the host DOM container was mounted or while its parent container had height: 0 or display: none.
Ensure the chart container element has an explicit height in CSS or inline styles (e.g., style={{ width: '100%', height: '500px' }}), and defer echarts.init() until after layout render inside requestAnimationFrame or useEffect.Root Cause: Tree-shaking failure where the agent imported 'echarts/core' but omitted registering CandlestickChart or BarChart using echarts.use().
import { CandlestickChart } from 'echarts/charts';
import { echarts } from './baseChart';
echarts.use([CandlestickChart]);Frequently Asked Questions (Apache ECharts Enterprise Visualizations SOP)
Q:Can I use Apache ECharts Enterprise Visualizations across Codex, Claude Code, and Cursor simultaneously?
Yes. The skill conforms to the universal SKILL.md specification. You can place the file in your root .agents/skills/ directory or your IDE-specific rule folders (.cursorrules or CLAUDE.md) without modifying the underlying instructions.
Q:How does Apache ECharts Enterprise Visualizations prevent context window overflow during long agent sessions?
The skill enforces modular ECharts configurations and reusable base definitions rather than generating repetitive 500-line declarative options for each chart, keeping context consumption under 400 tokens per prompt cycle.
Q:Does this skill require escalated root or container permissions?
No. The skill is audited with a security score of 98/100, requires zero shell execution permissions, and operates strictly within workspace file read/write limits without outbound network access.
Ready to equip your autonomous agent with Apache ECharts Enterprise Visualizations?
Copy the complete audited SKILL.md specification or download the 1-click zip bundle directly from our verified registry.