Skip to main content
100%

D3: An SVG element tooltip

✓ Published0🌍 Public
深深度碎片
Last edited Aug 3, 2016
Created on Aug 3, 2016

This example shows a bar chart built from a hardcoded array of numbers, with an SVG text tooltip that appears on mouseover to display each bar’s value. The tooltip is appended directly to the SVG and removed on mouseout. Clicking a bar sorts the rectangles in ascending or descending order using a staggered transition. The code uses D3 v4 with `scaleBand`, `scaleLinear`, and `transition` for sorting, while CSS `rect:hover` styling changes the fill to orange.

AI-generated description

Built with blockbuilder.org

gpl-3.0 Licensed

Similar vizzes