Overview
Pictorial bar charts use symbols or icons instead of traditional rectangular bars to represent data values. This chart type is highly customizable, allowing you to use circles, custom SVG paths, or any shape to create visually engaging and thematic data visualizations. Symbols can be repeated, clipped, or positioned in various ways to represent quantities.When to Use
Use pictorial bar charts when you need to:- Create visually distinctive and thematic charts that match your content
- Design infographic-style visualizations with custom icons
- Represent data with symbols that have semantic meaning (water drops for rainfall, bottles for beverages, etc.)
- Build progress indicators or rating displays with custom shapes
- Make data more accessible through visual metaphors
- Create engaging presentations where visual appeal is important
Basic Configuration
The pictorial bar chart is configured through thePictorialBarSeriesOption interface, working on cartesian coordinate systems.
Complete Example
Key Options
The symbol type to use for bars. Can be built-in symbols (
'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow') or a custom SVG path string prefixed with 'path://'.Size of the symbol. Can be:
- A number: absolute size in pixels
- A percentage string: relative to category width (e.g.,
'80%') - An array
[width, height]: separate dimensions null: auto-calculated based on data
Controls symbol repetition to represent quantity:
false: Single symbol (default)true: Auto-calculate repeats and clip by data value- A number: Fixed number of repetitions
'fixed': Auto-calculate repeats but don’t clip
Whether to clip the symbol by the actual data value. Useful for creating partially filled indicators.
Position of the symbol along the bar axis:
'start': At the axis baseline'end': At the value end'center': Centered on the valuenull: Auto-determined
Offset the symbol position. Can be numbers (pixels) or percentages relative to symbol size.
Margin between repeated symbols, as
[startMargin, endMargin] or a single value. Can be pixels or percentages.Rotation angle of the symbol in degrees.
Direction of symbol repetition:
'end': From start to end (default)'start': From end to start (reversed)
Defines the size reference for symbols. Useful for consistent sizing across categories.
Gap between bars. Pictorial bars default to
-100% (overlapping) to allow layering.Data Format
Pictorial bar data supports standard bar chart formats with per-item customization:Advanced Features
Rating Stars Display
Progress Indicators
Beverage Bottles Chart
Weather Icons Chart
Thermometer Chart
Stacked Icon Comparison
Design Tips
- Choose Meaningful Symbols: Use icons that relate to your data (drops for water, coins for money, etc.)
-
Maintain Proportions: When using custom SVG paths, ensure symbols scale proportionally:
-
Use symbolClip for Precision: Show exact values with partial fills:
- Layer for Depth: Combine multiple series with different z-index values for rich visuals.
- Optimize Symbol Complexity: Simpler SVG paths render faster and look cleaner at small sizes.
Performance Considerations
- Limit Symbol Complexity: Complex SVG paths can impact rendering performance.
-
Use symbolRepeat Wisely: High repeat counts can slow rendering:
-
Disable Animation for Many Items: For charts with many symbols:
Common Use Cases
Infographics
- Use thematic icons (people, buildings, vehicles)
- Set
symbolRepeat: trueto show quantities - Apply custom colors per category
Progress/Ratings
- Use stars, hearts, or checkmarks
- Enable
symbolClipfor partial fills - Layer background and foreground series
Dashboard Indicators
- Create gauge-like visualizations
- Use simple geometric symbols
- Apply gradients for modern look
Source Reference
The pictorial bar chart implementation can be found in:- Series model:
src/chart/bar/PictorialBarSeries.ts:128-184 - Type definitions:
src/chart/bar/PictorialBarSeries.ts:37-126 - Default options:
src/chart/bar/PictorialBarSeries.ts:139-177 - Symbol options:
src/chart/bar/PictorialBarSeries.ts:42-93