跪拜 Guibai
← All articles
Vue.js · ECharts · Frontend

RayChart Brings ECharts-Style Config to 3D Charts in Vue

By RayChart ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

3D dashboards are a frequent client demand, but building them from raw Three.js means days of coordinate math, camera setup, and animation tuning. RayChart collapses that to an ECharts-like config object, so a team that already knows ECharts can ship 3D visuals without hiring or becoming graphics programmers.

Summary

RayChart wraps Three.js rendering behind an ECharts-compatible option-object API. A bar chart needs only a series type and a data array dropped into a Vue component; the library handles lighting, shadows, and mouse-driven rotation automatically. The configuration style means anyone who has used ECharts can produce 3D visuals immediately, with TypeScript definitions providing editor autocomplete.

The library ships 16 chart types: bar, line, pie, scatter, radar, surface, funnel, gauge, liquid-fill, word cloud, graph, heatmap, and a 3D map. The 3D map is the standout — it bakes in fly-lines, flow lines, and path animations that would otherwise require manual curve interpolation in Three.js. A store-distribution dashboard page that previously took three days was finished in half a day.

A few practical gotchas: the container element needs an explicit height or the chart renders invisibly, and the library's CSS file must be imported separately to avoid visual breakage. The project is written in TypeScript with full type definitions, so VSCode catches misconfigured keys at development time.

Takeaways
RayChart uses an ECharts-compatible option-object API; a bar chart requires only a series type and a data array.
The library wraps Three.js and provides 16 chart types, including 3D maps with built-in fly-lines, flow lines, and path animations.
A 3D map dashboard page that previously took three days of Three.js work was completed in half a day.
The container element must have an explicit height, or the chart renders invisibly.
The CSS file must be imported separately (`import 'raychart/dist/raychart.css'`) to prevent visual distortion.
Full TypeScript definitions ship with the library, giving VSCode autocomplete on configuration keys.
Conclusions

RayChart's strategy — mirroring a dominant 2D library's API for a 3D equivalent — lowers the adoption barrier to near zero for the large existing ECharts user base.

The library does not bundle Vue or Three.js; it relies on peer dependencies already in the project, which avoids version conflicts and keeps the bundle smaller.

3D map fly-lines and path animations are pre-built abstractions over Three.js curve interpolation, removing the most time-consuming part of geo-visualization for dashboard developers.

Concepts & terms
ECharts-compatible option API
A configuration-object pattern where chart type, data, and styling are declared as plain JavaScript objects, matching the structure ECharts popularized in the 2D charting world.
fly-lines
Animated arcs drawn between geographic points on a 3D map, commonly used in logistics and smart-city dashboards to show movement or connections.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗