# nervure > Animated SVG charts, maps, diagrams and dashboards for every JavaScript framework. 214 charts (199 types), no dependency, MIT license. By Ali Ben Macha. Install: `npm install nervure`. Use: `import { createChart } from 'nervure'; createChart(element, spec, options)`. The element must have a height. A spec is one object with a `type`. Options: `theme`, `locale`, `animation` (false, or `{ speed, duration, delay, stagger, easing, effect, start }`), `toolbar` (export menu). Types: xy, pie, radar, gauge, scatter, heatmap, timeline, treemap, pack, funnel, waterfall, tree, candlestick, ohlc, heikinashi, renko, violin, beeswarm, ridgeline, histogram, errorbar, boxplot, hexbin, lollipop, dumbbell, bullet, slope, bump, pareto, likert, population, marimekko, pictogram, waffle, progress, bars3d, stream, horizon, parallel, kpi, rose, radialbar, polar, chord, liquid, thermometer, speedometer, venn, sankey, arc, network, pipeline, tunnel, sunburst, icicle, dendrogram, flowchart, orgchart, mindmap, sequence, er, quadrant, fishbone, cycle, triangle, steps, events, hexmap, ternary, calendar, punchcard, wordcloud, triangles, pitch, circuit, barrace, ranking, podium, bracket, body, organ, ecg, floorplan, building, tables, parliament, map. - [Everything in one file](https://nervurejs.github.io/llms-full.txt) - [Gallery with code](https://nervurejs.github.io/charts/) - [Frameworks](https://nervurejs.github.io/guide/frameworks): React, Next.js, Vue, Nuxt, Svelte, Angular, web component - [Symfony and Laravel](https://nervurejs.github.io/guide/symfony-laravel) - [CDN](https://nervurejs.github.io/guide/cdn) - [Size and lazy loading](https://nervurejs.github.io/guide/size) - [CSS](https://nervurejs.github.io/guide/css), [colours](https://nervurejs.github.io/guide/colours), [animation](https://nervurejs.github.io/guide/animation), [export](https://nervurejs.github.io/guide/export) - [Live data](https://nervurejs.github.io/guide/live): polling, server-sent events, WebSocket; [server side](https://nervurejs.github.io/guide/server) - [Maps of every country](https://nervurejs.github.io/maps/), [dashboards](https://nervurejs.github.io/guide/dashboards) - [API, every field](https://nervurejs.github.io/api) - [Comparison with other libraries](https://nervurejs.github.io/compare/) - [MCP server, skill and plugin](https://nervurejs.github.io/ai/): `npx -y nervure` - [Source](https://github.com/nervurejs/nervure) # Charts ## Lines and bars - [Line chart](https://nervurejs.github.io/charts/line-chart): Values that follow one another, joined by a line. Trends over time, two or three series compared. - [Area chart](https://nervurejs.github.io/charts/area-chart): A line filled down to zero. One quantity whose total matters as much as its shape. - [Step line](https://nervurejs.github.io/charts/step-line): A line that jumps from one value to the next. Prices, rates and stock levels that stay still between two changes. - [Range band](https://nervurejs.github.io/charts/range-band): The space between a low and a high series. Forecasts with their uncertainty, daily low and high. - [Bar chart](https://nervurejs.github.io/charts/bar-chart): One bar for each category. Comparing amounts side by side. - [Horizontal bar chart](https://nervurejs.github.io/charts/horizontal-bar-chart): Bars that run to the right, with their names on the left. Rankings, and names too long for the bottom of a chart. - [Grouped bar chart](https://nervurejs.github.io/charts/grouped-bar-chart): Several bars for each category. Comparing two or three series category by category. - [Stacked bar chart](https://nervurejs.github.io/charts/stacked-bar-chart): Parts piled up into a total. A total and what it is made of. - [Mixed chart with two axes](https://nervurejs.github.io/charts/mixed-chart-with-two-axes): Bars on one scale and a line on another. An amount and a rate in the same picture. - [Logarithmic chart](https://nervurejs.github.io/charts/logarithmic-chart): A scale where each step multiplies by ten. Growth, and values that differ by thousands. - [Sparkline](https://nervurejs.github.io/charts/sparkline): A line without axes, as small as a word. A trend inside a table or beside a figure. - [100 % stacked bar chart](https://nervurejs.github.io/charts/100-stacked-bar-chart): Bars of the same height, split into shares. How a mix changes from one category to the next, whatever the totals. - [Stacked bars in groups](https://nervurejs.github.io/charts/stacked-bars-in-groups): Several stacks side by side in each category. Two totals and their parts, compared category by category. - [Line chart with point styles](https://nervurejs.github.io/charts/line-chart-with-point-styles): Lines whose points have their own shapes. Series told apart without colour: printed in grey, or for readers who do not see every colour. - [Small multiples](https://nervurejs.github.io/charts/small-multiples): The same small chart for each group, on one scale. Comparing the shape of many series without a tangle of lines. ## Shares - [Pie chart](https://nervurejs.github.io/charts/pie-chart): Slices of a whole. Two to five shares that add up to a total. - [Donut chart](https://nervurejs.github.io/charts/donut-chart): A pie with room for a figure in the middle. Shares, with their total in the hole. - [Treemap](https://nervurejs.github.io/charts/treemap): Rectangles as large as their value. Many shares in little room. - [Packed bubbles](https://nervurejs.github.io/charts/packed-bubbles): Circles gathered around the largest. Shares when their order matters more than their exact size. - [Waffle chart](https://nervurejs.github.io/charts/waffle-chart): A hundred small squares shared between categories. Percentages that everybody can count. - [Marimekko chart](https://nervurejs.github.io/charts/marimekko-chart): Stacked columns as wide as their total. Market size and market share together. - [Sunburst chart](https://nervurejs.github.io/charts/sunburst-chart): Rings of slices, from the centre to the leaves. A hierarchy and the weight of each branch. - [Icicle chart](https://nervurejs.github.io/charts/icicle-chart): A hierarchy in columns of blocks. Deep hierarchies, with names that can be read. - [Venn diagram](https://nervurejs.github.io/charts/venn-diagram): Circles that overlap as much as their sets. What two or three groups have in common. - [Pictogram](https://nervurejs.github.io/charts/pictogram): Small figures, each worth the same amount. Numbers of people or things, for a wide audience. - [Circle packing](https://nervurejs.github.io/charts/circle-packing): Circles inside circles; a click zooms into a group. A hierarchy of sizes, explored level by level. ## Finance - [Candlestick chart](https://nervurejs.github.io/charts/candlestick-chart): Open, high, low and close of each period, with volume and moving averages. Stock, currency and crypto prices. - [OHLC bar chart](https://nervurejs.github.io/charts/ohlc-bar-chart): The four prices of a period on a thin bar. Prices over many periods, with less ink than candles. - [Heikin-Ashi chart](https://nervurejs.github.io/charts/heikin-ashi-chart): Candles smoothed by the ones before them. Reading a trend without its noise. - [Kagi chart](https://nervurejs.github.io/charts/kagi-chart): A line that turns only when prices come back far enough; thick above the last high, thin below the last low. Trends and reversals of a price, without the noise of small moves. - [Renko chart](https://nervurejs.github.io/charts/renko-chart): A brick each time the price moves by a fixed amount. Price moves, whatever the time they take. - [Point and figure chart](https://nervurejs.github.io/charts/point-and-figure-chart): Columns of X while the price rises by a box, of O while it falls; a new column after a move back of several boxes. Support, resistance and breakouts, without time or small moves. - [Market depth chart](https://nervurejs.github.io/charts/market-depth-chart): Bids and asks added up from the mid price outwards, as two steps. Order books: where buyers and sellers wait, and how thin the market is. - [Volume profile](https://nervurejs.github.io/charts/volume-profile): Prices with the volume traded at each level on the side, and the busiest level marked. Finding the prices where most of the trading happened. - [Drawdown chart](https://nervurejs.github.io/charts/drawdown-chart): How far a price or a portfolio stands below its last peak, with the deepest fall marked. The risk of a fund or a strategy, and how long it took to recover. - [Monthly returns](https://nervurejs.github.io/charts/monthly-returns): Years by months, green above zero and red below, with the return of each year. Performance reports of a fund, a portfolio or a strategy. ## Distribution - [Histogram](https://nervurejs.github.io/charts/histogram): How many values fall in each interval, with their density. The shape of a large sample. - [Box plot](https://nervurejs.github.io/charts/box-plot): Median, quartiles, whiskers and outliers. Comparing several samples at a glance. - [Violin plot](https://nervurejs.github.io/charts/violin-plot): The density of each sample, mirrored. Samples with more than one peak. - [Beeswarm plot](https://nervurejs.github.io/charts/beeswarm-plot): Every value as a point, none over another. Small samples, where each value counts. - [Ridgeline plot](https://nervurejs.github.io/charts/ridgeline-plot): Densities one above the other. How a distribution changes between groups or months. - [Error bars](https://nervurejs.github.io/charts/error-bars): A value and its interval. Measures with their uncertainty. - [Hexagonal bins](https://nervurejs.github.io/charts/hexagonal-bins): A cloud of points counted in hexagons. Thousands of points that would cover one another. - [Scatter and bubble chart](https://nervurejs.github.io/charts/scatter-and-bubble-chart): Points on two axes, with a size and a group. The link between two measures. - [Ternary plot](https://nervurejs.github.io/charts/ternary-plot): Three shares of a whole, in a triangle. Mixtures: soils, alloys, votes between three parties. - [Barcode plot](https://nervurejs.github.io/charts/barcode-plot): One thin tick for each value, a row for each group. Where values gather and where they are rare, in little room. - [Density plot](https://nervurejs.github.io/charts/density-plot): Smooth curves of where the values gather, one per group. Comparing the shape of two or three samples on one axis. - [Cumulative distribution](https://nervurejs.github.io/charts/cumulative-distribution): For each value, the share of the sample at or below it. Reading medians and percentiles, and comparing samples without bins. - [Q-Q plot](https://nervurejs.github.io/charts/q-q-plot): Sorted values against those of a normal distribution, with the line they would follow. Checking whether a sample is normal, skewed or has heavy tails. - [Raincloud plot](https://nervurejs.github.io/charts/raincloud-plot): Half a violin, a box and every value, for each group. Showing the shape, the summary and the raw data at once. - [Dot plot](https://nervurejs.github.io/charts/dot-plot): Each value as a dot, piled up in stacks. Small samples, where people should count the values. - [Strip plot](https://nervurejs.github.io/charts/strip-plot): Every value of each category, spread a little sideways, with the median. Small samples per group, without hiding a single value. - [Density contours](https://nervurejs.github.io/charts/density-contours): Lines around the places where points crowd together. Clouds of many points, and finding their centres. - [Regression line](https://nervurejs.github.io/charts/regression-line): Points with the line that fits them best, its band of confidence and R². Showing how much one measure follows another. - [Fan chart](https://nervurejs.github.io/charts/fan-chart): A history, then a forecast whose bands widen with time. Forecasts of sales, prices or rates, with how sure they are. - [Bubble chart](https://nervurejs.github.io/charts/bubble-chart): Points on two axes, sized by a third value, with names and groups. Comparing a few items on three measures at once. ## Comparison - [Lollipop chart](https://nervurejs.github.io/charts/lollipop-chart): A thin stem and a dot. Many categories with close values. - [Dumbbell chart](https://nervurejs.github.io/charts/dumbbell-chart): Two values joined by a line. Before and after, men and women, plan and result. - [Bullet chart](https://nervurejs.github.io/charts/bullet-chart): A value, its target and bands of quality. Goals, in the room of a line of text. - [Slope chart](https://nervurejs.github.io/charts/slope-chart): Two columns joined by straight lines. What rose and what fell between two dates. - [Bump chart](https://nervurejs.github.io/charts/bump-chart): Ranks over time. Who overtook whom. - [Pareto chart](https://nervurejs.github.io/charts/pareto-chart): Bars from the largest, and their running share. Finding the few causes of most problems. - [Likert chart](https://nervurejs.github.io/charts/likert-chart): Answers on both sides of a middle. Surveys with a scale of agreement. - [Population pyramid](https://nervurejs.github.io/charts/population-pyramid): Two sets of bars back to back. Ages of men and women, imports and exports. - [Progress bars](https://nervurejs.github.io/charts/progress-bars): How much of each goal is done. Tasks, quotas and levels. - [Parallel coordinates](https://nervurejs.github.io/charts/parallel-coordinates): One line for each item, across several axes. Comparing items on many measures. - [Waterfall chart](https://nervurejs.github.io/charts/waterfall-chart): Gains and losses between two totals. Explaining a profit, a budget or a head count. - [Key figure](https://nervurejs.github.io/charts/key-figure): A figure, its change and its trend. The top of a dashboard. - [Diverging bar chart](https://nervurejs.github.io/charts/diverging-bar-chart): Bars that go left or right of a middle. Gains and losses, above and below a target, agree and disagree. - [Range bar chart](https://nervurejs.github.io/charts/range-bar-chart): A floating bar from the lowest to the highest value, with a mark for today. Temperatures, prices and salaries: a span and where we stand in it. - [Cleveland dot plot](https://nervurejs.github.io/charts/cleveland-dot-plot): One or two dots for each row, sorted. Ranking many items, or showing before and after with less ink than bars. - [Scorecard](https://nervurejs.github.io/charts/scorecard): Names, figures, bars and arrows in a table. A short list of results and how each one changed. - [Nested bar chart](https://nervurejs.github.io/charts/nested-bar-chart): A narrow bar for the result inside a wide one for the target. Actual against plan, month by month. ## Time - [Stream graph](https://nervurejs.github.io/charts/stream-graph): Layers that swell and shrink around a middle. How a mix changes over time. - [Horizon chart](https://nervurejs.github.io/charts/horizon-chart): Many long series, each in a thin folded strip. Dozens of series on one screen. - [Calendar heatmap](https://nervurejs.github.io/charts/calendar-heatmap): A square for each day. Habits and activity over a year. - [Gantt chart](https://nervurejs.github.io/charts/gantt-chart): Bars on a calendar. Plans, phases and bookings. - [Event timeline](https://nervurejs.github.io/charts/event-timeline): Dates along a line. A history in a few moments. - [Time spiral](https://nervurejs.github.io/charts/time-spiral): One turn for each year, so that the same months line up. Seasons and cycles over several years. - [Gantt chart with dependencies](https://nervurejs.github.io/charts/gantt-chart-with-dependencies): Tasks on a calendar, arrows to the tasks that wait for them, milestones, progress and today. Project plans where the order of the work matters. - [Milestone timeline](https://nervurejs.github.io/charts/milestone-timeline): Dates down a line, with a card on one side then the other. The story of a project or a company, in a few steps. - [24-hour clock chart](https://nervurejs.github.io/charts/24-hour-clock-chart): A bar for each hour around a clock face, with a second series beside it. When things happen in a day: visits, calls, energy use. - [Weather forecast](https://nervurejs.github.io/charts/weather-forecast): Days or hours with a drawn sky, the highs and lows, and the chance of rain. Forecasts, and the weather of an event or a trip. - [Moon phases](https://nervurejs.github.io/charts/moon-phases): A month of drawn moons, computed from the dates, with the new and full moons. Calendars, tides, gardening, night events. ## Circles and gauges - [Radar chart](https://nervurejs.github.io/charts/radar-chart): Several criteria around a centre. Profiles of two or three items. - [Nightingale rose chart](https://nervurejs.github.io/charts/nightingale-rose-chart): Petals of the same angle, as large as their value. Months, directions, and other things that turn. - [Radial bar chart](https://nervurejs.github.io/charts/radial-bar-chart): Bars bent around a circle. A few percentages, with style. - [Polar chart](https://nervurejs.github.io/charts/polar-chart): A line around a dial. Hours of the day, directions of the wind. - [Chord diagram](https://nervurejs.github.io/charts/chord-diagram): Ribbons between the arcs of a circle. Exchanges between places, in both directions. - [Gauge chart](https://nervurejs.github.io/charts/gauge-chart): One value on a half circle, with a target. A single goal. - [Speedometer chart](https://nervurejs.github.io/charts/speedometer-chart): A needle over coloured zones. A value that is good, fair or bad. - [Liquid gauge](https://nervurejs.github.io/charts/liquid-gauge): A vessel that fills, with a moving surface. Levels: tanks, batteries, goals. - [Thermometer chart](https://nervurejs.github.io/charts/thermometer-chart): A column that rises in a tube. Temperatures and fundraising. - [Circular bar chart](https://nervurejs.github.io/charts/circular-bar-chart): Bars that radiate from a ring. Many categories, with style, when a ranking is not the point. - [Battery level](https://nervurejs.github.io/charts/battery-level): Batteries filled to their charge, red when low, with a bolt when they charge. Devices, vehicles and stocks that run down. ## Flows and networks - [Sankey diagram](https://nervurejs.github.io/charts/sankey-diagram): Ribbons as wide as what flows through them. Money, energy or visitors from step to step. - [Pipe chart](https://nervurejs.github.io/charts/pipe-chart): Pipes that narrow, leaks included, with a moving flow. A process that loses something on the way. - [Funnel chart](https://nervurejs.github.io/charts/funnel-chart): Steps that shrink, with the share that remains. Conversion rates. - [Tunnel chart](https://nervurejs.github.io/charts/tunnel-chart): Steps seen one inside the other. A funnel in little height. - [Network graph](https://nervurejs.github.io/charts/network-graph): Nodes spread by forces, and their links. Who is linked to whom. - [Arc diagram](https://nervurejs.github.io/charts/arc-diagram): Names on a line, joined by arcs. Links between things that have an order. - [Alluvial diagram](https://nervurejs.github.io/charts/alluvial-diagram): Stages in columns, and ribbons that show how the same items change category. Customers moving between plans, voters between parties, from year to year. - [Adjacency matrix](https://nervurejs.github.io/charts/adjacency-matrix): A network as a grid: a coloured cell for each link. Dense networks, where lines would tangle. ## Diagrams - [Flowchart](https://nervurejs.github.io/charts/flowchart): Boxes and arrows, laid out for you. Processes and decisions. - [Organisation chart](https://nervurejs.github.io/charts/organisation-chart): People or teams from the top down; branches fold. Who works with whom. - [Mind map](https://nervurejs.github.io/charts/mind-map): Ideas that branch from a centre. Plans, lessons, notes of a meeting. - [Sequence diagram](https://nervurejs.github.io/charts/sequence-diagram): Messages between actors, in order. Describing an exchange between programs. - [Entity relationship diagram](https://nervurejs.github.io/charts/entity-relationship-diagram): Tables, their fields and their links. Documenting a database. - [Radial tree](https://nervurejs.github.io/charts/radial-tree): A hierarchy around its root; branches fold. Wide trees in a square room. - [Dendrogram](https://nervurejs.github.io/charts/dendrogram): A hierarchy from left to right. Classifications and families. - [Quadrant chart](https://nervurejs.github.io/charts/quadrant-chart): Four zones and the points that fall in them. Priorities, SWOT, effort against value. - [Fishbone diagram](https://nervurejs.github.io/charts/fishbone-diagram): Causes along the bones of a problem. Finding why something went wrong. - [Cycle diagram](https://nervurejs.github.io/charts/cycle-diagram): Steps that come back to the first. Plan, do, check, act. - [Pyramid diagram](https://nervurejs.github.io/charts/pyramid-diagram): Levels of a triangle. Needs, strategies, layers of a system. - [Kanban board](https://nervurejs.github.io/charts/kanban-board): Columns of cards, with the work allowed in each column. Where the work stands, and where it piles up. - [Step diagram](https://nervurejs.github.io/charts/step-diagram): Arrows one after the other, done or to do. Where you are in a process. - [Tidy tree](https://nervurejs.github.io/charts/tidy-tree): A hierarchy from left to right, packed close; branches fold. Large trees, opened one branch at a time. - [Swimlane diagram](https://nervurejs.github.io/charts/swimlane-diagram): Steps in the band of the person who does them, joined by arrows. Who does what, and when the work changes hands. - [Customer journey map](https://nervurejs.github.io/charts/customer-journey-map): Stages, what the customer meets, and how they feel at each step. Finding where customers are let down. - [Pyramid of levels](https://nervurejs.github.io/charts/pyramid-of-levels): Levels from a narrow top to a wide base, with their value and share. Customer levels, sales stages, needs. - [Decision tree](https://nervurejs.github.io/charts/decision-tree): Choices, chances and outcomes, with the best path in bold. Comparing options whose result is uncertain. - [Product roadmap](https://nervurejs.github.io/charts/product-roadmap): Work on periods, by theme and by status, with today marked. Sharing what is done, under way and planned. - [SWOT analysis](https://nervurejs.github.io/charts/swot-analysis): Strengths, weaknesses, opportunities and threats in four boxes. A strategy meeting, a plan, a pitch. - [Work breakdown structure](https://nervurejs.github.io/charts/work-breakdown-structure): A project cut into parts and sub-parts, with their codes. Planning a project and sharing out the work. ## Grids - [Heatmap](https://nervurejs.github.io/charts/heatmap): A colour for each row and column. Days and hours, products and regions. - [Punch card](https://nervurejs.github.io/charts/punch-card): A circle for each row and column. When things happen. - [Hexagon map](https://nervurejs.github.io/charts/hexagon-map): Hexagons as tiles, with their value. Maps where each place counts the same. - [Triangle grid](https://nervurejs.github.io/charts/triangle-grid): Triangles up and down, as dark as their value. Many small values, as a pattern. - [Word cloud](https://nervurejs.github.io/charts/word-cloud): Words as large as their weight. A first look at a text. - [Bubble matrix](https://nervurejs.github.io/charts/bubble-matrix): Circles as large as their value, in rows and columns. Two dimensions crossed, when sizes speak better than colours. ## Sport - [Football pitch and line-up](https://nervurejs.github.io/charts/football-pitch-and-line-up): Two teams on a ground, by formation, and the path of the ball. Handball and basketball too. Line-ups, tactics and match reports. - [Race circuit](https://nervurejs.github.io/charts/race-circuit): Runners that move along a track, with their gaps. Motor races, running, cycling, sales contests. - [Tournament bracket](https://nervurejs.github.io/charts/tournament-bracket): Matches round after round, to the final. Cups and knock-out games. - [Podium](https://nervurejs.github.io/charts/podium): First, second and third, with pictures. Results and prizes. - [Top 5, top 10](https://nervurejs.github.io/charts/top-5-top-10): A ranking with pictures, figures and changes of rank. Best players, products, advisers. - [Bar chart race](https://nervurejs.github.io/charts/bar-chart-race): Bars that overtake one another year after year. How a ranking changed over time. - [League table](https://nervurejs.github.io/charts/league-table): Rank, games, goals, points and the last results of each team, with the zones of the table. Championships, leagues and sales contests. - [Football shot map](https://nervurejs.github.io/charts/football-shot-map): Shots on half a pitch, each circle as large as its chance of a goal, filled when it went in. Match reports, scouting and finishing. - [Pass network](https://nervurejs.github.io/charts/pass-network): Players at their average place on the pitch, joined by lines as thick as the passes between them. How a team builds its play, and who links it. - [Player heat map](https://nervurejs.github.io/charts/player-heat-map): Where one player touched the ball, warmer where he was most often, with his share in each third. Roles and positions of a player in a match. - [Basketball shot chart](https://nervurejs.github.io/charts/basketball-shot-chart): Shots on half a court, made or missed, with the success in the paint, in mid-range and from three. Where a player or a team scores best. - [Tennis scoreboard](https://nervurejs.github.io/charts/tennis-scoreboard): Games of each set, tie-breaks, the server and the winner, then the statistics of both players face to face. Match results and reports. - [Tennis serve map](https://nervurejs.github.io/charts/tennis-serve-map): Where the serves landed in the service boxes: aces, points won and lost, faults, wide, body or T. How a player serves and where to stand to return. - [Swimming race](https://nervurejs.github.io/charts/swimming-race): One lane for each swimmer, the time of each length, the final time, places and gaps. Swimming results, heats and finals. - [Athletics track race](https://nervurejs.github.io/charts/athletics-track-race): A track seen from above with its staggered starts, the runners on their lanes and the results in the middle. Sprints and middle-distance races. - [Cycling stage profile](https://nervurejs.github.io/charts/cycling-stage-profile): The height of a stage along its length, with its climbs by category, its sprints and its feed zones. Race books, previews and route plans. - [Golf scorecard](https://nervurejs.github.io/charts/golf-scorecard): Strokes on each hole against the par, birdies in circles and bogeys in squares, with the totals. Rounds, tournaments and friendly games. - [Running splits](https://nervurejs.github.io/charts/running-splits): The pace of each kilometre against a target: faster above the line, slower under it, with both halves. Marathons, races and training runs. - [Match timeline](https://nervurejs.github.io/charts/match-timeline): Goals, cards and changes minute by minute, one team above the line and the other under it. Match reports and live pages. - [Pizza chart](https://nervurejs.github.io/charts/pizza-chart): One slice for each figure of a player, as long as his percentile among his peers, coloured by group. Scouting and comparing a player with others in his role. - [Team stats face-off](https://nervurejs.github.io/charts/team-stats-face-off): Two teams face to face, figure by figure, each bar as long as its share. Match statistics: possession, shots, fouls. - [Win probability](https://nervurejs.github.io/charts/win-probability): The chances of a home win, a draw and an away win as the match goes on, with its goals. Match stories and the turning points of a game. - [Fight scorecard](https://nervurejs.github.io/charts/fight-scorecard): The cards of the judges round by round, the totals and the decision. Boxing, kickboxing and fights decided on points. - [Chess evaluation](https://nervurejs.github.io/charts/chess-evaluation): Who is better move after move, white under the curve and black above, with the mistakes and blunders. Reviewing a game of chess. - [Medal table](https://nervurejs.github.io/charts/medal-table): Gold, silver and bronze of each country or club, sorted as in the games. Games, championships and tournaments. ## Health - [Human body](https://nervurejs.github.io/charts/human-body): Figures on the organs of a body. Check-ups and lessons. It explains; it is not a medical tool. - [Organ](https://nervurejs.github.io/charts/organ): A heart that beats, lungs that breathe, with a figure. Vital signs and lessons. - [Heartbeat trace](https://nervurejs.github.io/charts/heartbeat-trace): A trace on paper, at the rate you give. Heart rates, and live signals. - [Activity rings](https://nervurejs.github.io/charts/activity-rings): Rings that close when a goal is reached, with a second lap beyond it. Daily goals: moving, exercise, steps, sales. - [Sleep stages](https://nervurejs.github.io/charts/sleep-stages): The stages of a night as steps, with the time spent in each. Sleep trackers and health reports. - [Blood pressure chart](https://nervurejs.github.io/charts/blood-pressure-chart): Readings on the grid of blood pressure categories, from normal to crisis. Home monitoring, check-ups and patient apps. - [Glucose curve](https://nervurejs.github.io/charts/glucose-curve): Blood sugar over a day, the target range, the meals and the time spent in range. Diabetes diaries and sensor apps. - [Heart rate zones](https://nervurejs.github.io/charts/heart-rate-zones): A heart rate trace over coloured zones, and the time spent in each one. Workouts, running and cycling apps. - [BMI scale](https://nervurejs.github.io/charts/bmi-scale): Body mass index on the scale of its categories, with the change since last time. Check-ups, weight programmes and wellness apps. - [Growth chart](https://nervurejs.github.io/charts/growth-chart): The height or weight of a child among percentile curves. Paediatric visits and child health records. - [Vaccination schedule](https://nervurejs.github.io/charts/vaccination-schedule): Doses by age, given, late or to come, and today. Child health records and clinics. - [Medication tracker](https://nervurejs.github.io/charts/medication-tracker): A week of doses, one pill a day for each medicine and time, taken or missed. Treatment follow-up, care homes and patient apps. - [Pain scale](https://nervurejs.github.io/charts/pain-scale): A score from 0 to 10 on a row of faces. Consultations, nursing notes and recovery diaries. - [Mood tracker](https://nervurejs.github.io/charts/mood-tracker): Mood day after day, as faces on five levels. Wellness and mental health diaries. - [Temperature chart](https://nervurejs.github.io/charts/temperature-chart): Body temperature, the fever line and the doses given. Hospital wards, children at home, care notes. - [Oxygen saturation](https://nervurejs.github.io/charts/oxygen-saturation): Saturation over a night, its bands, its drops and its lowest value. Sleep studies, oximeters and remote care. - [Step counter](https://nervurejs.github.io/charts/step-counter): Steps a day against a goal, with the days reached and the streak. Activity trackers and wellness challenges. - [Nutrition breakdown](https://nervurejs.github.io/charts/nutrition-breakdown): Calories by nutrient in a ring, and grams against a goal. Diet apps, meal plans and nutrition advice. - [Cycle wheel](https://nervurejs.github.io/charts/cycle-wheel): The days of a cycle in a wheel: period, fertile window, ovulation and today. Cycle tracking and health education. - [Bed occupancy](https://nervurejs.github.io/charts/bed-occupancy): The beds of each ward, occupied, reserved, free or closed, and the rate. Hospital capacity and daily huddles. - [Emergency triage](https://nervurejs.github.io/charts/emergency-triage): Patients waiting at each triage level, and their wait against its target. Emergency room screens and reports. - [Epidemic curve](https://nervurejs.github.io/charts/epidemic-curve): New cases a day, their moving average, the waves and the peak. Public health reports and outbreak follow-up. - [Dental chart](https://nervurejs.github.io/charts/dental-chart): The 32 teeth in two arches, numbered, by state. Dental records and treatment plans. - [Audiogram](https://nervurejs.github.io/charts/audiogram): The softest sound heard at each pitch, by ear, over the bands of hearing loss. Hearing tests and audiology reports. - [Lab results](https://nervurejs.github.io/charts/lab-results): Results against their reference ranges, flagged high or low, with the last value. Blood tests and patient portals. ## Places - [Floor plan](https://nervurejs.github.io/charts/floor-plan): The rooms of a home, at scale, with their area. Real estate, offices and shops. - [Building](https://nervurejs.github.io/charts/building): Floors and units, by state. Homes for sale, hotel rooms, beds, parking. - [Table plan](https://nervurejs.github.io/charts/table-plan): Tables of a room and their seats, by state. Restaurants, weddings, classrooms. - [Parliament chart](https://nervurejs.github.io/charts/parliament-chart): Seats in half circles. Elections, votes, boards. - [Seat map](https://nervurejs.github.io/charts/seat-map): Seats of a plane, a cinema or a theatre, by state and price. Booking seats and showing what is left. - [Elevation profile](https://nervurejs.github.io/charts/elevation-profile): The height of a route along its length, coloured by slope, with its peaks and passes. Hikes, bike rides, races and roads. - [Transit map](https://nervurejs.github.io/charts/transit-map): Lines through their stations on a clean grid, with the interchanges where they meet. Metro, tram and bus networks, and any map of lines and stops. - [Departures board](https://nervurejs.github.io/charts/departures-board): Times, destinations, platforms and delays, on a board that flips row by row. Stations, airports, bus stops and any screen of what leaves next. - [Stadium seating](https://nervurejs.github.io/charts/stadium-seating): The sections of a stadium around its field, coloured by the share of seats sold. Ticket sales for matches, concerts and shows. - [Car park](https://nervurejs.github.io/charts/car-park): Spaces seen from above, free or taken, with charging and accessible bays. Car parks, garages and any count of free spaces. - [Warehouse racks](https://nervurejs.github.io/charts/warehouse-racks): Racks seen from the aisle, each bin filled as much as it is. Stock, storage space and picking. - [Room bookings](https://nervurejs.github.io/charts/room-bookings): Meeting rooms over a day: bookings, free time and the share of the day taken. Offices, coworking spaces, schools and hospitals. - [Queues at counters](https://nervurejs.github.io/charts/queues-at-counters): People waiting at each counter, and how long it will take. Shops, banks, offices, airports and help desks. - [Lift traffic](https://nervurejs.github.io/charts/lift-traffic): The floors of a building, where each lift is, and the trips going up and down from each floor. Office towers, hotels and hospitals. - [Property card](https://nervurejs.github.io/charts/property-card): A home with its price, area and rooms, and its price per m² against the places around. Real estate listings, valuations and reports. - [Neighbourhood flower](https://nervurejs.github.io/charts/neighbourhood-flower): One petal for each kind of place nearby, as long as its score, with the walk to the nearest. Comparing where to live, and real estate listings. - [Skyline](https://nervurejs.github.io/charts/skyline): Values drawn as the buildings of a city, each as tall as its value. Rankings of towns, towers and districts, for a wide audience. - [Bus line strip](https://nervurejs.github.io/charts/bus-line-strip): The stops of one line in a row, the load on board between them, and where the bus is. Bus and tram lines, school runs and deliveries. - [Exhibition hall](https://nervurejs.github.io/charts/exhibition-hall): The stands of a hall to scale, sold, free or reserved, with the doors. Trade fairs, markets and events. - [Marina](https://nervurejs.github.io/charts/marina): Pontoons, berths and the boats moored in them, as long as they are. Ports, marinas, and any count of free berths. - [Energy label](https://nervurejs.github.io/charts/energy-label): Classes A to G, where a home stands on them, and its greenhouse gas beside. Real estate listings, building audits and renovation plans. - [Travel time rings](https://nervurejs.github.io/charts/travel-time-rings): Rings of minutes around a starting point, and the places each one reaches. Commutes, where to live, and the reach of a shop or a station. - [Route steps](https://nervurejs.github.io/charts/route-steps): The steps of a way on foot, a turn and a distance each, and where you are. Stations, airports, hospitals and campuses. - [Train crowding](https://nervurejs.github.io/charts/train-crowding): The cars of a train along its platform, by how full they are, and where to wait. Station screens and travel apps. - [Train graph](https://nervurejs.github.io/charts/train-graph): Stations down the side and time across: one line for each train, steep when it is fast. Timetables, and where trains meet or overtake. ## Maps - [Dorling cartogram](https://nervurejs.github.io/charts/dorling-cartogram): Each place becomes a circle as large as its value, near its true position, none over another. Populations, votes and sales by country, where large places would hide small ones. - [Proportional symbol map](https://nervurejs.github.io/charts/proportional-symbol-map): Circles as large as their value, on a pale map. Amounts by city or by site. - [Globe](https://nervurejs.github.io/charts/globe): The Earth as a ball that turns when you drag it, with values, points and routes. Flights, trade and anything seen from far away. - [Choropleth map](https://nervurejs.github.io/charts/choropleth-map): Each region as dark as its value, with a colour scale and a zoom. Rates and densities by country, region or department. - [Flow map](https://nervurejs.github.io/charts/flow-map): Curved arrows from place to place, as wide as their volume. Trade, migrations, deliveries and travel between places. - [Spike map](https://nervurejs.github.io/charts/spike-map): A spike at each place, as tall as its value. Populations and amounts by place, without hiding the map. - [Dot density map](https://nervurejs.github.io/charts/dot-density-map): Dots scattered inside each region, one dot for a given number, a colour for each group. How people or things spread over a land, and how groups mix. - [Hexbin map](https://nervurejs.github.io/charts/hexbin-map): Hexagons over the map, as dark as the number of points inside. Thousands of places, where single dots would pile up. - [Pin map](https://nervurejs.github.io/charts/pin-map): Pins that gather into numbered circles when close; a circle opens on zoom, a pin opens a card. Shops, agencies and sites to find on a map. - [Pie chart map](https://nervurejs.github.io/charts/pie-chart-map): A small pie at each place, as large as its total, cut by its parts. The mix of each place: energy, votes, sales by product. ## 3D - [3D bar chart](https://nervurejs.github.io/charts/3d-bar-chart): Isometric columns on a floor of rows and columns. A few values on two dimensions, when the picture has to strike. - [3D column chart](https://nervurejs.github.io/charts/3d-column-chart): Columns standing on a floor, the series side by side, with a grid on the back walls; drag to turn it. A cover page or a slide, with few categories and few series. - [3D cylinder chart](https://nervurejs.github.io/charts/3d-cylinder-chart): Round columns on a floor, side by side in each category. The same as columns, when round shapes suit the subject better. - [3D cone chart](https://nervurejs.github.io/charts/3d-cone-chart): Cones as high as their value, one for each category. A handful of values shown as peaks. - [3D stacked column chart](https://nervurejs.github.io/charts/3d-stacked-column-chart): Parts piled up into a column for each category. A total and what it is made of, on a cover page. - [3D 100 % stacked chart](https://nervurejs.github.io/charts/3d-100-stacked-chart): Round columns of the same height, cut into shares. How a mix changes from one category to the next, whatever the totals. - [3D pie chart](https://nervurejs.github.io/charts/3d-pie-chart): A pie with a thickness, seen from above, a slice pulled out. Two to five shares, when one of them has to stand out. - [3D donut chart](https://nervurejs.github.io/charts/3d-donut-chart): A ring with a thickness, seen from above. Shares, in a picture that has to strike more than inform. - [3D area chart](https://nervurejs.github.io/charts/3d-area-chart): Several series as ribbons, one behind the other. Three or four series over time, each with its own shape. - [3D surface](https://nervurejs.github.io/charts/3d-surface): A grid of heights drawn as a surface, coloured by height, that turns when dragged. A value that depends on two others: terrain, a response surface, a yield by price and volume. - [3D wireframe](https://nervurejs.github.io/charts/3d-wireframe): The same surface as a mesh of lines, the far side hidden. A light picture of a surface, printed or in a report. - [3D scatter plot](https://nervurejs.github.io/charts/3d-scatter-plot): Points in a box with three axes, sized by a fourth value, with lines down to the floor. Clusters on three measures, explored by turning the box. - [3D pyramid](https://nervurejs.github.io/charts/3d-pyramid): A pyramid cut into layers as high as their value, the first one at the top. Levels of a hierarchy or of a population. - [3D funnel](https://nervurejs.github.io/charts/3d-funnel): Round layers as wide as their value, from the first step to the last. A sales or sign-up funnel, on a slide. - [3D prism map](https://nervurejs.github.io/charts/3d-prism-map): Each place raised as high as its value, coloured by it too. Amounts by region, when a striking picture matters more than exact reading. - [3D bubble chart](https://nervurejs.github.io/charts/3d-bubble-chart): Bubbles in a box with three axes, as large as a fourth value, shaded like balls, with their shadows on the floor. Four measures at once, explored by turning the box. - [3D layered area chart](https://nervurejs.github.io/charts/3d-layered-area-chart): Each series as a solid layer filled down to the floor, one behind the other. Two to four series over time, on a cover page. - [3D stacked area chart](https://nervurejs.github.io/charts/3d-stacked-area-chart): The series piled up into one solid block, each layer on the one below. A total over time and what it is made of. - [3D line chart](https://nervurejs.github.io/charts/3d-line-chart): A path through a box with three axes, with balls at its points and its shadow on the floor. A trajectory: a flight, a walk, a value that moves on three measures. - [3D histogram](https://nervurejs.github.io/charts/3d-histogram): Columns on a grid of two kinds of categories, as high as their count and coloured by it. How a population spreads over two groupings: age and income, size and price. - [3D waterfall chart](https://nervurejs.github.io/charts/3d-waterfall-chart): Blocks that rise and fall from one total to the next. A bridge from one figure to another, on a slide. - [3D gauge](https://nervurejs.github.io/charts/3d-gauge): A dial with a thick ring, a bevel, coloured bands, a target and a needle. One figure against its range, on a cover or a dashboard that has to strike. - [3D tank chart](https://nervurejs.github.io/charts/3d-tank-chart): Glass tanks side by side, each filled up to its value. Levels and capacities: stocks, budgets used, reservoirs. - [3D cone chart](https://nervurejs.github.io/charts/3d-cone-chart): A cone cut into slices whose volume follows their value, the first one at the top. Levels of a hierarchy, when a round shape suits the subject. - [3D polar area chart](https://nervurejs.github.io/charts/3d-polar-area-chart): Wedges of the same angle around a centre, as wide and as high as their value. Values over the months or the directions of a compass. - [3D heatmap](https://nervurejs.github.io/charts/3d-heatmap): Raised tiles on a grid, each one as high and as dark as its value, with a colour scale. Activity by day and hour, when the peaks have to stand out. - [3D globe](https://nervurejs.github.io/charts/3d-globe): Bars standing on a globe at their places, as high as their value; drag to turn the Earth. Figures by city or site around the world, on a cover or a slide. - [3D building](https://nervurejs.github.io/charts/3d-building): A building whose floors are coloured by their value, the ground floor first. Occupancy, energy or rent floor by floor, for real estate. - [3D treemap](https://nervurejs.github.io/charts/3d-treemap): Treemap tiles raised as high as their value, or as a second value. Shares of a whole, when the picture has to strike. - [3D flow](https://nervurejs.github.io/charts/3d-flow): A Sankey diagram lying on a floor: blocks for the stages, thick ribbons for the flows. Where visitors, money or goods go, stage after stage. - [3D radar](https://nervurejs.github.io/charts/3d-radar): Radar polygons of several series raised as plates, one above the other. A few profiles over five to eight measures, year after year. - [3D progress tubes](https://nervurejs.github.io/charts/3d-progress-tubes): Glass tubes filled up to their value, a ring at their target. Progress towards goals, on a dashboard or a slide. - [3D pictorial chart](https://nervurejs.github.io/charts/3d-pictorial-chart): Units counted with 3D houses, cubes or trees, one lane for each item. Counts people grasp at once: homes sold, cars, trees planted. - [3D pictorial chart, cars](https://nervurejs.github.io/charts/3d-pictorial-chart-cars): The same lanes of icons, counted with cars. A fleet or sales by kind of vehicle. - [3D candlesticks](https://nervurejs.github.io/charts/3d-candlesticks): Candlesticks as boxes, as deep as their volume. Prices and volumes of a few weeks, in one picture. - [3D timeline](https://nervurejs.github.io/charts/3d-timeline): Events on posts along a road that goes away from the eye. A roadmap or the story of a project, on a slide. - [3D calendar wall](https://nervurejs.github.io/charts/3d-calendar-wall): A calendar heatmap as an isometric wall: one block for each day, as high as its value. Activity day by day over months, in the style of a contributions graph. ## Weather - [Meteogram](https://nervurejs.github.io/charts/meteogram): Temperature, rain and wind on one time axis: a line, bars and an arrow for each step. Forecasts for a place over a few days, the way weather services draw them. - [Wind rose](https://nervurejs.github.io/charts/wind-rose): How often the wind blows from each direction, petals split by speed, with the calm in the middle. Airports, wind farms, sailing, building sites: where the wind comes from and how strong. - [Sun path](https://nervurejs.github.io/charts/sun-path): The arc of the sun over a day, sunrise, sunset and twilights, the moon, and where the sun stands now. Daylight of a place and a date: gardens, photography, solar panels, events outdoors. - [Barometer](https://nervurejs.github.io/charts/barometer): Air pressure on the dial of a barometer, with the reading of a few hours before and the tendency. Weather stations, and telling whether the weather is about to change. ## Nature - [Tree rings](https://nervurejs.github.io/charts/tree-rings): The rings of a trunk, one a year, as wide as the growth of that year, with dry years pointed at. Climate history, forests, and any yearly growth told as a living thing. - [River level](https://nervurejs.github.io/charts/river-level): The height of a river over time, its flood levels as bands, the peak and the forecast. Flood warnings, rivers, reservoirs and tides. - [Air quality index](https://nervurejs.github.io/charts/air-quality-index): An index on its coloured bands, and the pollutants that make it. Cities, schools, health apps: is the air good today, and why not. - [Species count](https://nervurejs.github.io/charts/species-count): Rows of small animals, one for a number counted, with the change since the last survey. Bird counts, biodiversity surveys and reports for a wide audience. ## Electricity - [Load curve](https://nervurejs.github.io/charts/load-curve): Power used over a day, the peak hours shaded, and the price on a second scale. Grids, factories and buildings: when power is used, and what it costs then. - [Generation mix](https://nervurejs.github.io/charts/generation-mix): What makes the power of a grid over a day, source by source, with the demand on top. Grid operators, energy news, and how much of the power is low-carbon. - [Power plant board](https://nervurejs.github.io/charts/power-plant-board): Each unit as a tile: its state, what it gives and its capacity, and the totals. Control rooms and dashboards of producers. - [Electricity meter](https://nervurejs.github.io/charts/electricity-meter): The index of a meter on rolling digits, what was used since a reading, and its registers. Energy apps and bills: what a home or a site used. - [Tariff clock](https://nervurejs.github.io/charts/tariff-clock): A 24-hour dial of the tariff periods and their price, the use of each hour inside, and the hour now. Choosing when to run machines, charge a car or heat water. ## Nuclear - [Reactor panel](https://nervurejs.github.io/charts/reactor-panel): A reactor with its control rods and fuel, and its power, temperature and pressure beside. Teaching, simulators and plant dashboards. - [Dose rate dial](https://nervurejs.github.io/charts/dose-rate-dial): A dose rate of radiation on a logarithmic dial with its bands, and the dose added up against its limit. Radiation monitoring, labs, hospitals and the public around a site. - [Reactor fleet](https://nervurejs.github.io/charts/reactor-fleet): Reactors over weeks: running, refuelling, stopped, and the power the fleet has left. Planning outages and following the availability of a fleet. ## Oil and gas - [Crude oil spread](https://nervurejs.github.io/charts/crude-oil-spread): Two crude oil prices and the gap between them, as a band and as bars. Energy markets, trading desks and reports on oil. - [Tank farm](https://nervurejs.github.io/charts/tank-farm): Storage tanks in 3D, each filled to its level, as wide as its capacity. Depots, terminals and refineries: what is stored and where there is room. - [Refinery yields](https://nervurejs.github.io/charts/refinery-yields): A distillation column and the products drawn off it, light at the top, as thick as their share. What a barrel of crude becomes, for teaching and refinery reports. - [Gas storage](https://nervurejs.github.io/charts/gas-storage): How full the gas storage is over the year, against the range of past years and a target. Following the filling before winter, for a country or a site. - [Degree days](https://nervurejs.github.io/charts/degree-days): Heating degree days against the normal, with the gas used each month. Energy bills and building management: was it colder, or did we use more? ## Transport - [Delay heat strip](https://nervurejs.github.io/charts/delay-heat-strip): Lines down the side and hours across, each cell coloured by the average delay, with the share on time. Punctuality of a network by hour or by day, and where the rush hours hurt. - [Mode share](https://nervurejs.github.io/charts/mode-share): How people travel, split by mode with an icon for each, against a target or another year. Mobility plans, commuter surveys and city reports. - [Door-to-door journeys](https://nervurejs.github.io/charts/door-to-door-journeys): Several ways of making one trip, their legs to scale, with the time, cost and CO₂ of each. Comparing the metro, the bus, the bike and the car for the same trip. ## Cars - [Car dashboard](https://nervurejs.github.io/charts/car-dashboard): Speed and engine speed on two dials, the gear, fuel or battery, temperature and range. Telematics, driving simulators and fleet screens. - [EV charging session](https://nervurejs.github.io/charts/ev-charging-session): State of charge and charging power over a session, the energy added and when 80 % is reached. Charging apps, fleet reports and charger tests. - [Car service log](https://nervurejs.github.io/charts/car-service-log): Work done and to come along the odometer, and how far the next one is. Maintenance books, fleets and used car listings. ## Real estate - [Price per m² ladder](https://nervurejs.github.io/charts/price-per-m-ladder): Districts placed on one ladder by their price per m², their range beside, and a home placed on it. Valuations, listings and market reports. - [Rental yield grid](https://nervurejs.github.io/charts/rental-yield-grid): The yield of a rental for a range of prices and rents, the home studied ringed. Choosing a buy-to-let and how much to offer. - [3D building lots](https://nervurejs.github.io/charts/3d-building-lots): A building in 3D, its lots coloured by sale state, that turns when dragged. New-build programmes, sales offices and lettings. ## Financing - [Loan amortization](https://nervurejs.github.io/charts/loan-amortization): Principal, interest and insurance of each year of a loan, and what is left to pay. Mortgage and car loan simulators. - [Debt ratio gauge](https://nervurejs.github.io/charts/debt-ratio-gauge): Monthly charges against income on a dial with an example limit, and the income cut into its parts. Loan applications and budget advice. - [Borrowing capacity](https://nervurejs.github.io/charts/borrowing-capacity): How much one can borrow over 10 to 25 years, with the deposit and the price aimed at. Mortgage simulators and home buying plans. ## Crypto - [Halving and supply](https://nervurejs.github.io/charts/halving-and-supply): Coins issued against the cap, the reward of each era, and the blocks left to the next halving. Explaining the supply of a coin with halvings. - [Volatility cone](https://nervurejs.github.io/charts/volatility-cone): The range of past volatility over several windows, and where it stands now. Judging if a market is calm or wild against its own past. - [Crypto wallet](https://nervurejs.github.io/charts/crypto-wallet): What each coin is worth and its share, its move over a day, and the whole on a ring. Portfolio apps and wallet summaries. ## Money - [Compound savings](https://nervurejs.github.io/charts/compound-savings): What was put in and what the interest added, year by year, with a goal. Savings plans, pension and education funds. - [Budget envelopes](https://nervurejs.github.io/charts/budget-envelopes): One envelope for each kind of spending, filled as the money goes, with the pace of the month. Household budgets and team expense limits. - [Exchange rate board](https://nervurejs.github.io/charts/exchange-rate-board): An amount in several currencies, with the move and the path of each rate. Travel, payments and treasury screens. ## Products - [Product comparison matrix](https://nervurejs.github.io/charts/product-comparison-matrix): Products side by side, feature by feature, the best of each row marked. Shops, buying guides and product pages. - [Star ratings](https://nervurejs.github.io/charts/star-ratings): The average in stars, how many gave each number, and scores by aspect. Reviews on product pages and in shop reports. - [Price history with promotions](https://nervurejs.github.io/charts/price-history-with-promotions): Price over time, its promotions and the real cut against the lowest price before each. Price trackers and checking a sale. - [Stock level and reorder point](https://nervurejs.github.io/charts/stock-level-and-reorder-point): Stock over time against its reorder point and safety stock, with orders and their lead time. Inventory, purchasing and shop dashboards. # 3D charts Thirty chart types draw solids with a thickness: `pie3d`, `donut3d`, `columns3d`, `stacked3d`, `ribbon3d`, `area3d`, `surface3d`, `scatter3d`, `bubbles3d`, `line3d`, `histogram3d`, `heatmap3d`, `waterfall3d`, `gauge3d`, `cylinder3d`, `pyramid3d`, `funnel3d`, `cone3d`, `polar3d`, `map3d`, `globe3d`, `building3d`, `treemap3d`, `flow3d`, `radar3d`, `progress3d`, `pictorial3d`, `candles3d`, `timeline3d` and `wall3d`. They are plain SVG (no WebGL, no canvas), so they export to SVG and PNG, take the theme and the palette, have tooltips, a legend and keyboard reading like every other chart. `bars3d` is the older isometric chart of the main file. ## Load them The 3D types are a separate entry, so they do not grow the main file (about 35 kB gzipped for all thirty): ```ts import { createChart } from 'nervure'; import 'nervure/3d'; // registers the 3D types createChart(host, { type: 'pie3d', data: [{ name: 'Rent', value: 42 }, { name: 'Food', value: 30 }] }); ``` In a page without a bundler, load the browser file after the main one: ```html ``` `nervure/lazy` knows them too: `createChart` from `nervure/lazy` fetches the code of a 3D type the first time it is drawn. ## The view and turning it Every 3D chart takes a `view`, in degrees: `azimuth` turns around the vertical axis, `elevation` goes from the floor (0) to straight above (90). Each type has a default that shows it well. ```ts { type: 'surface3d', z, view: { azimuth: 60, elevation: 35 }, rotate: true } ``` With `rotate: true`: - a drag on the chart turns it (left and right around, up and down in height); - a button in the top right corner takes the focus with Tab; the arrow keys turn the view by steps, Enter or Home goes back to `view`. Each step draws the chart again from the new eye, so the labels, the tooltips and the order in which the faces cover one another stay right; nothing is a CSS transform. Turning keeps the size of the drawing, so nothing jumps. `chart.update(spec)` goes back to the view of the spec. The faces take the colour of their series in the light: tops lighter, sides darker. This works in the light and dark themes and with your palette (colours written as `#rgb`, `#rrggbb` or `rgb()`; other colours are drawn flat). With reduced motion, the charts appear at once, as every other chart does. ## The types | Type | Data | Options | |---|---|---| | `pie3d`, `donut3d` | `data: { name, value }[]` | `explode` (names or indexes), `depth`, `hole` (donut), `labels`, `legend` | | `columns3d` | `categories`, `series: { name, data }[]` | `shape: 'box' \| 'cylinder' \| 'cone' \| 'pyramid'`, `width`, `min`, `max` | | `stacked3d` | `categories`, `series` | `percent`, `shape: 'box' \| 'cylinder'` | | `ribbon3d` | `categories`, `series` | `thickness`, `curve: 'smooth'` | | `surface3d` | `z: number[][]`, `x`, `y` names | `colors`, `wireframe`, `titles` | | `scatter3d` | `series: { name, data: { x, y, z, size? }[] }[]` | `drops`, `radius`, `titles` | | `pyramid3d` | `data` (first at the top) | `sizing: 'value' \| 'equal'`, `shape: 'square' \| 'round'`, `gap` | | `funnel3d` | `data` (first at the top) | `shape`, `gap` | | `map3d` | `geo` (GeoJSON or TopoJSON), `values` by id | `key`, `nameKey`, `color`, `height` | | `bubbles3d` | `series: { name, data: { x, y, z, size }[] }[]` | `radius`, `shadows`, `titles` | | `area3d` | `categories`, `series` | `stacked`, `percent`, `thickness`, `min`, `max` | | `line3d` | `series: { name, data: { x, y, z, label? }[] }[]` (points in their order) | `markers`, `shadow`, `drops`, `titles` | | `histogram3d` | `z: number[][]`, `x`, `y` names | `colors`, `width`, `titles` | | `heatmap3d` | `columns`, `rows`, `values: number[][]` | `colors`, `height` | | `waterfall3d` | `data: { name, value, total? }[]` | `up`, `down`, `totalColor`, `width`, `connectors` | | `gauge3d` | `value` | `min`, `max`, `bands: { to, color }[]`, `target`, `name`, `unit`, `color` | | `cylinder3d` | `data: { name, value, max? }[]` | `max` (size of the tanks), `unit` | | `cone3d` | `data` (first at the top) | `sizing: 'volume' \| 'height' \| 'equal'`, `apex: 'top' \| 'bottom'`, `gap` | | `polar3d` | `data` | `radius: 'value' \| 'equal'`, `height`, `labels`, `legend` | | `globe3d` | `data: { name, lon, lat, value }[]` | `geo` (land), `shape: 'bar' \| 'spike'`, `height`, `color` | | `building3d` | `data` (the ground floor first; `value` may be null) | `colors`, `min`, `max`, `footprint`, `windows` | | `treemap3d` | `data: { name, value, height? }[]` | `height`, `legend` | | `flow3d` | `links: { source, target, value }[]` | `colors` by node | | `radar3d` | `axes`, `series` | `max`, `legend` | | `progress3d` | `data: { name, value, target?, max? }[]` | `max` | | `pictorial3d` | `data` | `icon: 'cube' \| 'house' \| 'car' \| 'tree' \| 'cylinder'`, `unit`, `perRow` | | `candles3d` | `data: { label, open, high, low, close, volume? }[]` | `up`, `down` | | `timeline3d` | `events: { label, date?, text? }[]` | `color` (of the road) | | `wall3d` | `data: { date: 'YYYY-MM-DD', value }[]` | `colors`, `weekStart` | A few notes on the newer types: - `area3d` fills each series down to the floor, as a solid layer behind the one before (the first series at the back); `stacked: true` piles the series into one block, `percent: true` makes every category 100 % high. `ribbon3d` draws the same data as thinner ribbons. - `bubbles3d` is `scatter3d` with a fourth value: the area of each ball follows its `size`, and its shadow on the floor tells where it stands. - `line3d` joins the points of each series in their order, a path through space, and draws it again on the floor; the pieces of the path and the balls are sorted by depth, so a path that crosses itself is drawn right. - `histogram3d` and `heatmap3d` take a grid of values: the first is a city of columns with an axis of heights, the second a flat grid of tiles with a colour scale, for when the colour matters more than the height. - `waterfall3d` reads `data` like the flat `waterfall`: a step adds its value to the running total, a `total` stands from the floor; the tooltips give the change and the running total. - `gauge3d` is a dial lying on a table: tilt it with `view.elevation` (90 shows it flat, from above). - `cylinder3d` fills a glass tank for each item; the tooltip gives the share of the tank and its size. - `cone3d` cuts a cone into slices; by default each slice holds a share of its volume as large as its value, so the slices near the point are taller. - `polar3d` gives each item a wedge of the same angle, as high as its value and with an area that follows it (`radius: 'equal'` keeps them all as wide). Every field is on the page of each chart in the [gallery](/charts/#three-d). ### Globes, buildings and other pictures - **`globe3d`** stands a bar (or a spike with `shape: 'spike'`) on each place, as high as its value, on a globe seen from far away. Without a `view`, the eye faces the middle of the places; drag it, or use the arrow keys of the turn button, to turn the Earth. `geo` draws the land (the `world` or `continents` file of `loadMap`); without it the globe has a grid of meridians and parallels only. Bars behind the Earth stay hidden, except where they stand out of its rim. - **`building3d`** colours each floor of a building by its value — occupancy, energy, rent — with windows on its walls and the names of the floors on the right. The first item is the ground floor. - **`treemap3d`** lays the tiles of a treemap on a floor and raises them, by their value or by a second value, `height` (the growth of a shop, its margin). - **`flow3d`** is a Sankey diagram lying on a table: a block for each node, the stages from left to right, the flows as thick ribbons as wide as their value. - **`radar3d`** raises the polygon of each series as a plate, the first one at the bottom; the dots on the plates are read with the keyboard. - **`progress3d`** fills a glass tube for each item up to its value, out of its own `max` or the common one; a dark ring marks its `target`. - **`pictorial3d`** counts units with icons in one lane for each item: `1 icon = 10` is written in the corner, and the last icon is cut to the share left over. The unit is chosen so that the longest lane holds at most 40 icons, unless `unit` says otherwise. - **`candles3d`** draws each candlestick as a box, as deep as its volume, with the prices on the back walls. - **`timeline3d`** puts events on posts along a road that goes away from the eye, the first one in front; a `date` places them, else they are evenly spaced. - **`wall3d`** is a calendar heatmap built as a wall of blocks, one for each day, weeks along the width and days of the week across. ## When 3D is a bad idea Most of the time. A 3D chart is harder to read than the flat one it comes from: - **Lengths and angles lie.** A slice at the front of a 3D pie looks larger than the same slice at the back; a column far away seems shorter. Readers compare shapes, not numbers. - **Things hide each other.** A tall column, ribbon or region covers what stands behind it. Turning helps, but a printed page or a screenshot cannot turn. - **The axes are hard to follow.** Reading a height against a grid on the back wall is slow and inaccurate. So prefer the flat charts — `xy` bars, `pie`, `heatmap`, `scatter`, `map` — to report figures, and keep 3D for a cover, a slide or a picture meant to strike, with few categories and the figures in the tooltips or in a table (`table: 'toggle'`). Two cases where 3D earns its place: a **surface** of a value that depends on two others, which a flat heatmap shows less naturally, and a **3D scatter** explored by turning it, to see clusters on three measures. The keyboard, the screen reader text and the CSV, Markdown and table exports carry the exact figures whatever the picture shows. ## Size The charts stay readable at 300 px wide; below 150 px the axes and labels give way, and below 110 px high the legend too, and only the drawing is kept. # Accessibility - Each chart is an image with a text: its `title` and `description`, or a summary of the data. Write your own `description` for what the chart shows. - Points, items and tree nodes that can be clicked take the focus and answer to Enter and Space. - Charts do not move for people who ask for reduced motion. - Text in shapes is black or white, whichever reads better. - Colour is not always enough: add labels, or a table beside the chart. ## Keyboard Tab reaches the chart. Then: | Key | Does | |---|---| | ← → | previous or next mark of the series | | ↑ ↓ | the same place in the previous or next series | | Home, End | first or last mark of the series | | Enter, Space | what a click on the mark does | | Escape | leaves the marks | The mark gets a ring and its tooltip, and a live region says it to screen readers: `Sales, Mar: 30`. Lines, bars, areas, scatter points, pie slices, treemaps and most charts that show one shape by value map to their marks. The others are read row by row from their table, with nothing drawn. Rings and tooltips do not move, so they suit readers who ask for reduced motion. Click the chart or reach it with Tab, then use the arrows. `keyboard: false` turns this off, for a sparkline in a list for example. ## Data table ```ts createChart(host, spec, { table: true }); // under the chart createChart(host, spec, { table: 'beside' }); // on the right, the drawing takes 60 % createChart(host, spec, { table: 'toggle' }); // a Table button in the toolbar ``` The table is plain HTML (`
| `), with the same rows as the CSV export and the format of the chart. It is never part of the SVG or PNG export. Style it with `.nervure-table`.
## Safety
Names and categories are written as text, never parsed as HTML. `decorate` and colours come from your code: do not build them from what visitors type.
# Animation
## On or off
```ts
createChart(host, spec); // animated
createChart(host, spec, { animation: false }); // drawn at once
```
People who ask their system for less motion get no animation, whatever you write.
## When
```ts
createChart(host, spec, { animation: { start: 'load' } }); // at once, the default
createChart(host, spec, { animation: { start: 'visible' } }); // when the reader scrolls to it
const chart = createChart(host, spec, { animation: { start: 'manual' } });
button.onclick = () => chart.play(); // when you decide, as often as you want
```
The room of the chart is kept while it waits, so nothing on the page jumps.
## How
| Option | Does |
|---|---|
| `speed` | `2` is twice as fast |
| `duration` | milliseconds for each mark, instead of the timing of the chart |
| `delay` | milliseconds before the first mark |
| `stagger` | `false` moves every mark together |
| `easing` | `linear`, `ease`, `ease-in`, `ease-out`, `ease-in-out`, `bounce`, `elastic`, or any CSS easing such as `cubic-bezier(.34,1.56,.64,1)` |
| `effect` | `fade` replaces movement by a fade |
| `loop` | plays the entrance again and again, with a pause between two runs; `update()` and `refresh()` start it again with the new data, `destroy()` stops it |
| `line` | how the lines of `xy` charts come in: `trace` (default), `grow` or `draw` |
## Easing
`bounce` and `elastic` go past the end and come back. They are written as a CSS `linear()` curve; a browser that cannot read it uses the easing of the chart instead.
```ts
createChart(host, spec, { animation: { easing: 'bounce' } });
createChart(host, spec, { animation: { easing: 'ease-out', duration: 600 } });
```
## Lines
```ts
createChart(host, spec, { animation: { line: 'draw' } });
```
| `line` | Lines come in |
|---|---|
| `trace` (default) | traced along their length, each series a little after the one before |
| `grow` | up from the axis, with their areas and points |
| `draw` | from left to right at an even pace: the line, its area, its dots and its labels are uncovered together, like a pen drawing it |
`line` applies to lines, areas and bands of `xy` charts; bars and other charts keep their own entrance. With `effect: 'fade'`, lines fade like the rest.
## Loop
```ts
createChart(host, spec, { animation: { loop: true, line: 'draw' } });
```
The entrance plays again once every movement has ended, after a short pause, until `update` with another spec, `refresh` (live data) or `destroy`. People who ask their system for less motion see the chart drawn once, still.
Charts use the Web Animations API of the browser: no timer runs once they are drawn. Only `liquid` and `pipeline` with `flow` move without end.
`chart.update(spec)` plays again; `chart.refresh(spec)` does not, for live data.
# Axes
The value axes of `xy` charts are listed in `axes` (the first one is the default axis, on the left). `scatter` charts, bubbles included, take `xAxis` and `yAxis`. Every one of them reads the same options.
| Option | Does |
|---|---|
| `min`, `max` | fixed ends: the data cannot move them |
| `suggestedMin`, `suggestedMax` | ends the axis reaches at least; data beyond them still widens it |
| `step` | gap between two ticks, such as `5` |
| `ticks` | about how many ticks |
| `format` | a function, or options: `{ currency: 'EUR', compact: true }` |
| `tickFormat` | `(value, index) => string`: the text of each tick, from code |
| `grid` | `false` hides the grid of this axis; `{ dashed: true, color: '#ccc' }` changes it |
| `scale` | `log`: powers of ten; zero and negative values have no place on it |
| `title` | the name of the axis |
`step` and `ticks` round the range to the step; with `min` and `max` set, the ticks start at the first multiple of the step. A step that would write more than 200 ticks is ignored. A log axis has its ticks at the powers of ten, whatever `step` and `ticks` say.
## A suggested range
A score out of 100 that only reached 64 so far still shows the whole scale; a score of 130 would widen it:
```ts
axes: [{ suggestedMin: 0, suggestedMax: 100 }]
```
`min` and `max` win over the suggested ends.
## Ticks from code
```ts
axes: [
{ step: 1000, tickFormat: (value, index) => (index === 0 ? '' : `${value / 1000} k`) },
{ side: 'right', format: { percent: true }, grid: false },
]
```
`tickFormat` writes the ticks only; tooltips keep the `format` of the chart.
## Grid of each axis
The first axis draws the grid by default, following `grid` of the chart (`false`, `'dashed'`). Each axis can draw its own:
```ts
axes: [{ grid: false }, { side: 'right', grid: { dashed: true, color: '#94a3b8' } }]
```
## Scatter and bubbles
```ts
{
type: 'scatter',
data,
xAxis: { min: 0, step: 10, title: 'Price' },
yAxis: { suggestedMax: 100, format: { compact: true }, grid: { dashed: true } },
}
```
`xAxis.title` and `yAxis.title` replace `xLabel` and `yLabel` when both are given.
## Axes crossing at zero
`center: true` draws the two axes through zero, inside the drawing, with their ticks beside them: a plane of gains and losses, of four quadrants. When zero is out of the range, the axis stays at the nearest end.
```ts
{ type: 'scatter', center: true, data, xAxis: { suggestedMin: -40, suggestedMax: 40 } }
```
# CDN and plain HTML
```html
```
The web component is included:
```html
(selected = p.label) }} style="height: 300px">
```
```js
// the element: point-click and point-hover, the point in event.detail
document.querySelector('nervure-chart').addEventListener('point-click', (e) => console.log(e.detail.label));
```
# Export
## A menu
`toolbar: true` adds a small button. It takes the formats, their labels, the name of the file, an icon, and what to write in the file. The formats are `svg`, `png` and `csv` by default; `md` and `figma` are there when you ask for them:
```ts
createChart(host, spec, { toolbar: { formats: ['svg', 'png', 'csv', 'md', 'figma'] } });
```
## From code
```ts
await chart.download('png', 'orders', { title: 'Orders', subtitle: '2026', caption: 'Source: me', background: '#fff', padding: 24, scale: 3 });
const svg = chart.toSVG({ title: 'Orders' });
const png = await chart.toPNG({ scale: 2 });
const csv = chart.toCSV();
const md = chart.toMarkdown();
```
| Option | Does |
|---|---|
| `title`, `subtitle`, `caption` | text written in the file only |
| `background` | the theme in PNG, transparent in SVG |
| `padding` | pixels around the drawing |
| `scale` | PNG only, 2 by default |
Headings, notes, what `decorate` adds and what your CSS changed are kept; tooltips and buttons are not. PNG files use system fonts, because a browser does not load web fonts inside an image. Cells of a CSV that look like a formula get a quote in front.
## Markdown
`chart.toMarkdown()` writes the data of the chart as a Markdown table, under the title of the chart as a heading: the same rows as the CSV, with the figures written as on the chart (its `format` and `locale`) and numbers aligned to the right. Paste it in a README, an issue, a wiki or a message to a language model. On a server, without a chart, `toMarkdown(spec)` from `nervure/render` does the same.
## Figma
`chart.toSVG({ figma: true })` writes an SVG made to be pasted in Figma, and `await chart.copyForFigma()` puts it on the clipboard (as `image/svg+xml` and as text): paste it in a Figma file and it becomes layers you can edit. In the menu, `figma` copies it, or saves the file when the browser refuses the clipboard.
- Layers are named after the parts of the chart: `axes`, `series`, `legend`, `legend-item Sales`, `heading`… (`id` and `data-name`).
- Text stays text, with its font family, size and weight written on it. A family Figma cannot know, such as `system-ui` or `sans-serif`, becomes Inter; set `font` in the theme to the font you use in Figma.
- CSS variables and `currentColor` become the colours they stand for. Halos behind labels are dropped, as Figma draws them over the letters.
- Nothing is in a `foreignObject`. Clip paths stay only where a chart needs them (liquid gauge, pictograms, avatars).
## Many points
A scatter plot with more than 3000 points paints them on a canvas (`render: 'auto'`, or `'canvas'` and `'svg'` to choose). Axes, legend and labels stay SVG; the tooltip and the click still find the nearest point. In an SVG export the points become a picture (a PNG inside the SVG), drawn at the resolution of the screen; in a PNG export they are drawn as the rest. For a file with real vector points, set `render: 'svg'`: the browser is slower with that many elements, but the file can be edited point by point.
# Figures
A figure counts, stops exactly where you said, and compares itself.
## In the text of a page
```ts
import { createFigure } from 'nervure/figure';
const sales = createFigure(host, {
value: 1284500,
label: 'Sales',
format: { currency: 'EUR', compact: true, letters: ['K', 'M', 'B'] },
compare: [
{ value: 1100000, label: 'last year' },
{ value: 1300000, label: 'target', show: 'both' },
],
animation: { start: 'visible', duration: 1800 },
});
sales.update({ value: 1310000 }); // counts from the figure shown
```
```html
` and other tags, and character codes such as `#quot;` are written out. ## Warnings `parseMermaid` gives the spec, the kind of diagram and what was left out: ```ts import { parseMermaid } from 'nervure/mermaid'; const result = parseMermaid(text); if (result) { result.kind; // 'sequence' result.spec; // { type: 'sequence', actors: [...], messages: [...] } result.warnings; // ['Notes are left out.'] } ``` An app can choose Mermaid when there are warnings, or show them beside the chart. ## Without a bundler Load `cdn/nervure.mermaid.min.js` after the main file: `nervure.fromMermaid` and `nervure.parseMermaid` are then there. ```html ``` ## On a server With [`nervure/render`](/guide/server), a Mermaid block becomes an SVG string without a browser: ```ts import { fromMermaid } from 'nervure/mermaid'; import { renderToSVG } from 'nervure/render'; const spec = fromMermaid(text); const svg = spec ? renderToSVG(spec, { width: 800, height: 400 }) : null; ``` # Plugins A plugin draws something more on a chart, at each drawing: a frame, a text in the hole of a donut, a message when there is no data. ```ts import { createChart, registerPlugin } from 'nervure'; import { centerLabel, emptyState, plotAreaBorder } from 'nervure/plugins'; // on one chart createChart(host, donut, { plugins: [centerLabel({ text: '1,284', sub: 'orders' })] }); // on every chart drawn from now on const remove = registerPlugin(emptyState({ text: 'Nothing to show yet' })); remove(); // when no longer wanted ``` `nervure/plugins` is a file of its own: the main bundle does not grow when you do not use it. ## Ready-made | Plugin | Draws | Options | |---|---|---| | `plotAreaBorder()` | a frame around the area where the data is drawn, inside the axes | `color`, `width`, `radius`, `dashed`, `fill` (behind the marks) | | `centerLabel({ text })` | a text in the hole of a donut, a pie or a gauge; in the middle for other charts | `text`, `sub` (a line under it), `color`, `size`; `text` and `sub` can be functions of the context | | `emptyState()` | a message in the middle when the spec has no value | `text` (`No data`), `color` | ## Your own A plugin is an object with an `id` and up to three hooks: ```ts import type { NervurePlugin } from 'nervure'; const watermark: NervurePlugin = { id: 'watermark', afterDraw(c) { c.add('text', { x: c.area.x + c.area.width - 6, y: c.area.y + c.area.height - 6, 'text-anchor': 'end', 'font-size': 10, 'font-family': c.theme.font, fill: c.theme.muted, }, 'below', 'Draft'); }, }; ``` | Hook | When | |---|---| | `beforeDraw(context)` | the drawing is empty; `area` is still the whole drawing | | `afterDraw(context)` | the chart is drawn; `area` and `hole` are known | | `onDestroy(context)` | `destroy()`: let go of what you hold | The context: | Field | Holds | |---|---| | `svg`, `width`, `height` | the SVG of the chart and its size in pixels | | `area` | `{ x, y, width, height }` where the data is drawn (inside the axes of `xy`, `scatter`, `heatmap`, `waterfall`…, the circle of a `pie` or a `radar`); the whole drawing for the other charts | | `hole` | `{ x, y, r }` of the hole of a donut, a pie or a gauge | | `spec`, `theme` | the spec drawn, and the colours and font in use | | `empty` | true when the spec has no value | | `below`, `above` | two layers, under the chart (grid and marks) and above it, emptied at each drawing | | `add(tag, attributes, layer?, text?)` | adds an SVG element to a layer, `above` by default; `text` is written as text | - Use `c.theme` colours: plugins then follow the light and dark themes. - What a plugin draws is part of the SVG and PNG exports, and of [`renderToSVG`](/guide/server). - One plugin by `id`: a plugin given to a chart replaces a registered one with the same `id`. - Elements above the marks should take `pointer-events="none"`, so the tooltip keeps working under them. # Series and bars The `xy` chart (lines, areas and bars) takes a few fields that change how each series is drawn. | Field | Where | Does | |---|---|---| | `stack` | a series | with `stacked`, bars of the same stack pile up; other stacks stand beside them | | `color`, `colors` | a series | a colour, or a function of each value (from code only) | | `dots` | a series | `false` hides the points, `{ shape, size }` changes them | | `radius` | the chart | rounded corners of the bars, in pixels (4 by default, 0 for square bars) | | `barWidth` | the chart | share of a category taken by its bars, from 0 to 1 (0.72 by default) | ## Stack groups With `stacked: true`, every bar series piles into one bar per category. Give series a `stack` name and each name gets a pile of its own, side by side in the category: two totals and their parts, compared at once. ```js { type: 'xy', categories: ['Q1', 'Q2', 'Q3', 'Q4'], stacked: true, legend: true, series: [ { name: 'Coffee (Shop)', kind: 'bar', stack: 'Shop', data: [30, 34, 28, 41] }, { name: 'Tea (Shop)', kind: 'bar', stack: 'Shop', data: [18, 22, 25, 20] }, { name: 'Coffee (Web)', kind: 'bar', stack: 'Web', data: [12, 19, 26, 33] }, { name: 'Tea (Web)', kind: 'bar', stack: 'Web', data: [9, 11, 14, 18] }, ], } ``` - Series without a `stack` share one pile, as before. - `stacked: 'percent'` fills 100 % with each stack on its own. - `totals: true` writes one total by stack at the end of horizontal bars, and lists them all in the tooltip (`Total Shop`, `Total Web`). - The keyboard says the stack with the name of the series (`Coffee (Shop), Q1: 30`) when there are several stacks. - `stack` does nothing on bars that are not stacked. CSV and Markdown exports keep one column for each series. ## Colours from values `color` and `colors` take a function as well as a text: `(value, index, category) => colour`. It is called for each value that is not empty; `index` is the place in `data` (zoomed or thinned charts give the same index), `category` the text of the category (a date as `2024-03-01`). ```ts series: [{ name: 'Result', kind: 'bar', data: [12, -4, 8, -9, 15], color: (value) => (value < 0 ? '#dc2626' : '#16a34a'), }] ``` - A list in `colors` wins over the function, point by point. - The legend, the line of a line series and the exports take the first colour worked out. - Pie and donut charts take `color: (value, index, name) => colour` for the slices with no colour of their own; scatter charts take `color: (y, index, label) => colour`. ::: warning From code only A function cannot be written in JSON. Specs written as JSON (the editor, the MCP server, the `spec` attribute of ` ${escape(String(p.value))} €`, }, }); ``` The tooltip is a `div.nervure-tooltip`: style what you put in it [with CSS](/guide/css). ## Place `position`: `auto` (default: on the right of the pointer, on the left near the edge), `top`, `bottom`, `left` or `right`. The tooltip always stays inside the chart. ```ts createChart(host, spec, { tooltip: { position: 'top' } }); ``` ## From code ```ts const chart = createChart(host, spec); chart.showTooltip('Visits', 3); // series name (or its place, 0, 1…) and index of the mark chart.hideTooltip(); chart.setActive('Visits', 3); // rings the mark, as the keyboard does, until… chart.setActive(null); ``` For charts with one list of marks (`pie`, `treemap`, `funnel`…), any series name works: `chart.showTooltip('', 2)`. The ring of `setActive` stays when the chart is drawn again. Neither calls `onHover`. ## Scatter The `tooltip` field of a `scatter` spec still writes its lines; the `format` or `html` of the option wins when both are given. # Zoom ## Any chart ```ts const chart = createChart(host, spec, { zoom: true }); ``` | Gesture | Does | |---|---| | Buttons | closer, further, back | | Ctrl or ⌘ and wheel, two fingers | closer, around the pointer | | Drag | moves, once closer | | Double click | back | The plain wheel keeps scrolling the page. Buttons work with the keyboard. Useful for `network`, `sankey`, `flowchart`, `er`, `mindmap`, `timeline`, `tree`, `bracket`, and any dense drawing. In an export, the part on screen is saved. ## Lines, bars and prices ```ts createChart(host, { type: 'xy', zoom: true, … }); // drag to look closer, double click to come back createChart(host, { type: 'candlestick', zoom: true, … }); // moving averages remember the prices before chart.zoom(10, 25); // categories 10 to 25 chart.resetZoom(); ``` Axes are drawn again for the part shown, which a plain enlargement cannot do. ## Maps `zoom: true` in the spec of a [map](/guide/maps): buttons, drag, ctrl and wheel; a globe turns. ## In the component ```tsx |
|---|