💎 Version 6.0.0 #5242
junedchhipa
started this conversation in
Show and Tell
💎 Version 6.0.0
#5242
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
ApexCharts 6.0.0
The largest release in the library's history. Version 6 turns a chart from a picture you look at into a surface you investigate, author, and share. Most of what follows is opt-in and tree-shakeable; existing configs keep working unchanged, and the zero-dependency, SVG-first identity is intact.
Two behaviors change by default (both respect
prefers-reduced-motionand the existingdynamicAnimation.enabledescape hatch): data updates that add or remove points now animate coherently, and mobile pinch/pan gestures are on. See Fixes for the details.✨ Features
Weave: public plugin platform
Publish reusable chart plugins to npm against a stable, versioned API. A plugin draws into its own sandboxed layer and subscribes to lifecycle hooks; it never touches raw internal state.
api.layeris a plugin-owned drawing surface (path/line/rect/circle/text);api.scalesconverts data to pixels;api.data,api.theme, andapi.storeround out the facade.apiVersiongates the contract so raw internals can keep changing safely.ApexCharts.unregisterPlugin(name)exists for tests and hot reload.Strata: hybrid SVG + canvas renderer
Break the SVG node ceiling without leaving SVG behind. Below a threshold the output is identical SVG; above it, only the series layer becomes a
<canvas>while axes, grid, tooltips, annotations, and exports stay SVG.Marks: composable custom series types
Register a
renderItem(datum, scales, api)function and get a first-class series: events, shared tooltip, legend, and keyboard navigation all work with no extra wiring.Dumbbell, lollipop, and bullet ship as samples. Built-in type names are guarded against shadowing.
Rewind: history and undo/redo
Generic Ctrl-Z over a command journal. Zooms, series toggles, option changes, and annotation edits are recorded; high-frequency gestures coalesce into a single step.
Perspectives: shareable view state
Serialize the exact view (zoom window, hidden series, selection, annotations, theme) into a compact token you can put in a URL and restore anywhere.
Facet: design tokens and OS-aware themes
Charts read
--apx-*CSS custom properties from the cascade, follow the operating system's light/dark and contrast preferences with no JS, and can reference named brand themes.chart.refreshTokens()re-reads the cascade after a runtime token change that does not itself trigger a render.Cadence: pluggable easing
chart.animations.easingaccepts a named curve, a cubic-bezier array, or a function. The default is unchanged, so existing charts animate exactly as before.A data-change override is available via
chart.animations.dynamicAnimation.easing.Linked Views: crossfilter and cross-chart coordination
Coordinate a group of charts without wiring. In highlight mode, brushing one chart dims the non-matching marks in the others (no redraw). A real crossfilter engine adds categorical click-filters, range brushes, a shared data-table, and a heatmap 2D matrix target.
Ink Layer: direct-manipulation annotation authoring
Annotations become draggable and resizable, with click-to-create, snap to gridlines, and a floating editor card (inline rename, recolor, bold, font size, marker size and shape, delete). Every edit is undoable when Rewind is enabled.
Measure ruler
Hold a key and drag to read the change, percent, range, and slope between two points; on release the ruler pins as a data-anchored overlay that re-projects on zoom and resize.
mode: 'span'is the finance-style vertical band with a change/percent/range readout;mode: 'free'is a diagonal ruler between two arbitrary points. Styling resolves through--apx-measure-*tokens.Context menu (Radial Actions)
Right-click or long-press a data point for verbs that act at that exact point rather than chart-wide.
Built-in
annotate/xline/ylineitems are ink-managed when the ink feature is bundled (they open the floating editor and undo via Rewind).Storyboard: scroll-driven choreography (scrollytelling)
Pair prose sections with saved views. Scrolling a beat past the viewport trigger applies its view; scrolling back reverses it. Each beat can also merge an
updateOptionspayload so it can restyle or morphchart.typeinside one animated transition.Real-time streaming: constant-velocity scroll
Rolling-window updates now scroll at constant velocity instead of warping in place, and
chart.streamingbounds memory for long-running feeds.The scroll animation itself needs no opt-in: any update that continues the previous window (
appendData, or a shifted fixed-lengthupdateSeries) translates smoothly.🔧 Behavior changes (on by default)
Coherent variable-length data transitions
Updates that change the number of data points now animate as one coordinated motion instead of popping. Appended bars grow from the baseline, removed bars shrink into ghosts and fade out, line and area fills reshape over the union of old and new points (so they can never tear), and markers, bubbles, and axis tick labels ride along on the same clock. This also gives scatter and bubble charts dynamic-update animations for the first time, and bubbles tween their radius on
zchanges. Zoom re-projections animate their marks and ticks too.Disable per chart with
chart.animations.dynamicAnimation.enabled: false. Skipped automatically abovechart.animations.largeDatasetThresholdand whenprefers-reduced-motionis set.Native-feeling mobile gestures (Momentum)
Two-finger pinch-zoom around the centroid, two-finger pan, and kinetic inertia after a one-finger flick, with axis rails so a vertical swipe still scrolls the page. Configurable via
chart.zoom.pinchandchart.pan.inertia.🐛 Fixes
render()is idempotent: a repeatedrender()call (including a framework double-invoking an effect) returns the same promise instead of building a duplicate chart in the same element.destroy()clears it so an instance can render fresh; a rejected render clears itself so callers can retry.hideSeries/showSeries/toggleSeriesno longer silently no-op under strict CSS selector engines (the series lookup no longer relies on an escaped-colon attribute selector).pathFrom(doublez) that fed the animation engine an invalid command list on area updates.📦 Tree-shaking
Every feature above ships as a tree-shakeable entry (
apexcharts/features/*) registered through the feature registry; the core stays lean. See the tree-shaking guide for the complete list of entry points.TypeScript
Full type definitions ship with the package (no
@types/*install). 6.0 adds types for every new config namespace and API, plus the SSR statics (renderToString,renderToHTML,hydrate,hydrateAll,isHydrated).This discussion was created from the release 💎 Version 6.0.0.
Beta Was this translation helpful? Give feedback.
All reactions