A versatile circular chart component for WinCC Unified that displays data as proportional segments of a circle. Ideal for visualizing distribution data, resource allocation, production mix ratios, and percentage-based metrics in industrial automation and SCADA applications.
Overview
The Pie/Doughnut Chart component provides professional circular data visualization with flexible support for multiple segments (recommended maximum of 8). It offers two display modes: solid pie chart for straightforward proportion display, and doughnut chart with customizable center text for enhanced information density. Built on Chart.js, it integrates seamlessly with WinCC Unified runtime for real-time process monitoring and distribution analysis. The component uses array-based properties for data, labels, and colors, allowing dynamic configuration through screen scripts.
Component Type
Data Visualization Control / Distribution Display
Key Features
Dual Modes: Toggle between pie and doughnut chart styles
Flexible Segments: Support for variable number of segments (up to 8 recommended) using array properties
Array-Based Configuration: Data, Labels, and Colors properties use structured arrays for easy dynamic updates
Center Text: Display custom text or total value in doughnut center
Interactive Legend: Color-coded legend with optional percentage display
Dynamic Updates: Real-time data updates with smooth animations
Flexible Cutout: Adjustable inner radius (0-90%) for doughnut thickness control
Auto-Hide: Segments with zero values automatically hidden
Responsive Design: Adapts to component size with optimal layout
Script-Friendly: Properties designed for easy manipulation via WinCC Unified screen scripts
Properties
Title
Type: string
Category: Appearance
Description: The text displayed at the top of the chart
Usage: Set this property to identify the distribution or data category being visualized
ChartType = "pie"// CutoutPercentage ignored in pie mode// CenterText not visible in pie mode
When to Use Doughnut Chart
Best For:
Displaying 3-8 segments with varying sizes
When center text adds valuable context
Modern, professional HMI designs
Showing totals or KPIs in center
Multi-level information display
Advantages:
Center area available for critical information
Modern, professional appearance
Better segment separation in crowded displays
Adjustable ring thickness via CutoutPercentage
Reduces visual weight in busy screens
Configuration:
ChartType = "doughnut"CutoutPercentage = 60 // Adjust thicknessCenterText = "Total" // Utilize center space
Comparison Summary
| Aspect | Pie Chart | Doughnut Chart |
|--------|-----------|----------------|
| Segment Area | Maximum | Reduced by cutout |
| Center Text | Not visible | Fully supported |
| Visual Weight | Heavier | Lighter, modern |
| Segment Count | 2-4 optimal | 3-8 optimal |
| Use Case | Simple distributions | Complex distributions |
| Information Density | Lower | Higher with center text |
Color Format Reference
WinCC Unified uses 32-bit ARGB color values:
Format: 0xAARRGGBB
A: Alpha (transparency) - 00 (transparent) to FF (opaque)
R: Red component - 00 to FF
G: Green component - 00 to FF
B: Blue component - 00 to FF
Conversion Formula:
DecimalValue = (A * 16777216) + (R * 65536) + (G * 256) + B
Standard Process Colors:
Green (Normal): 4278255360 (0xFF00FF00)
Yellow (Warning): 4294944000 (0xFFFFA500)
Red (Alarm): 4294901760 (0xFFFF0000)
Blue (Info): 4278190335 (0xFF0000FF)
Gray (Inactive): 4286611584 (0xFF808080)
White (Text): 4294967295 (0xFFFFFFFF)
Black (Background): 4278190080 (0xFF000000)
Default Segment Colors (as decimal values):
Blue: 4283215696 (0xFF36A2EB)
Green: 4283782485 (0xFF4BC0C0)
Orange: 4294936576 (0xFFFF9F40)
Red: 4294923520 (0xFFFF6384)
Purple: 4287889619 (0xFF9966FF)
Cyan: 4278233343 (0xFF00FFFF)
Pink: 4294951115 (0xFFFFCD56)
Teal: 4289309097 (0xFF4BC0C0)
Color Selection Guidelines:
Use fully opaque colors for segments (alpha = FF)
Ensure adjacent segments have distinguishable colors
Follow corporate or process color standards
Use standard status colors (green/yellow/red) for state visualization
Test color combinations for colorblind accessibility
Best Practices
1. Array Configuration
Use Only Needed Elements: Include only necessary items in Data, Labels, and Colors arrays; set unused values to 0 to hide them
Maintain Array Synchronization: Keep Data, Labels, and Colors arrays with matching lengths for consistent display
Meaningful Labels: Use clear, concise labels in Labels array that operators understand immediately
Color Coding: Apply consistent color schemes across all HMI screens using Colors array
Value Ranges: Data array values can be any positive number; component calculates proportions automatically
2. Visual Design
Limit Segments: Use 2-6 array elements for optimal readability; avoid overcrowding with too many segments
Color Contrast: Ensure sufficient visual separation between adjacent segment colors in Colors array
Legend Placement: Enable ShowLegend unless segment meanings are obvious
Center Text: Use doughnut mode with meaningful center text for information density
Sizing: Maintain minimum component size of 300x300 pixels for legend readability
3. Data Representation
Appropriate Use Cases: Use for part-to-whole relationships, not trends over time
Value Types: Works with absolute values, percentages, or counts in Data array
Zero Handling: Array items with value 0 are hidden automatically
Total Display: Leave CenterText empty to show calculated total in doughnut center
Percentage Display: Enable ShowPercentages when exact proportions matter
4. Performance Optimization
Update Frequency: Update Data array at 1-5 second intervals for smooth transitions
Avoid Rapid Changes: Frequent updates to large arrays can affect rendering performance
Script-Based Updates: Use screen scripts to build arrays from PLC tags efficiently
Batch Updates: Update all three arrays (Data, Labels, Colors) in a single script execution when possible
5. Operator Experience
Clear Identification: Always set descriptive Title for context
Legend Visibility: Enable ShowLegend for unfamiliar distributions
Percentage Display: Enable ShowPercentages for precise analysis
Status Colors: Use green/yellow/red for state or quality distributions
Contrast: Ensure ForegroundColor contrasts well with ChartBackgroundColor
6. Doughnut Mode Optimization
Cutout Range: Use 50-70% for standard doughnut appearance
Center Text Length: Keep under 10 characters for optimal font sizing
Information Hierarchy: Use center text for most critical metric
Thick vs Thin: Thicker rings (lower cutout) emphasize segment sizes; thinner rings (higher cutout) emphasize center content
When to Use Pie/Doughnut Charts vs Other Chart Types
Use Pie/Doughnut Charts When:
Visualizing part-to-whole relationships
Showing distribution across 2-8 categories
Displaying resource allocation or utilization
Representing market share or production mix
Comparing proportions at a single point in time
Space constraints favor circular layout
Percentage-based data is primary focus
Use Bar Chart Instead When:
Comparing discrete values without showing total
Displaying more than 8 categories
Showing time-series or sequential data
Precise value comparison is more important than proportions
Categories have very similar values (hard to distinguish in pie)
Percentages automatically calculated and displayed
Doughnut center provides additional information area
Pie/Doughnut Chart Limitations:
Not suitable for more than 8 segments
Difficult to compare similar-sized segments precisely
Cannot show trends over time
Not ideal for very small proportions (< 5%)
Less effective than bars for exact value comparison
Integration with WinCC Unified
Runtime Behavior
Component initializes on screen load with configured default values
Property changes trigger smooth chart transitions with animation (300ms duration)
WebCC API manages bidirectional communication with WinCC Unified runtime
Segments with zero values automatically excluded from display
Percentages recalculated automatically when any segment value changes
Chart rebuilds completely when ChartType changes between pie and doughnut
Data Binding Options
Important: WinCC Unified does not support direct tag binding to array elements. You must use screen scripts to populate array properties from PLC tags.
Animation: Smooth 300ms transitions for data updates
Memory: Efficient memory usage suitable for multiple chart instances
Resolution: Responsive design adapts to component size (minimum 250x250px recommended)
Troubleshooting Common Issues
Chart Not Displaying or Blank Screen
Possible Causes:
All segment values are 0
Component size is too small (below 100x100 pixels)
ChartBackgroundColor matches segment colors
Component not visible or positioned off-screen
Solutions:
Verify at least one segment has value > 0
Increase component dimensions to minimum 250x250 pixels
Check color settings for sufficient contrast
Confirm component visibility and position properties
Segments Not Showing Expected Proportions
Possible Causes:
Segment values include negative numbers (not supported)
Values are NaN, null, or undefined
Incorrect tag binding or data type mismatch
Solutions:
Ensure all segment values are non-negative numbers (>= 0)
Verify tag bindings return valid numeric values
Check PLC tag data types match expected format
Use default values for testing to isolate configuration issues
Center Text Not Visible
Possible Causes:
ChartType set to "pie" instead of "doughnut"
CutoutPercentage too low (< 20)
ForegroundColor matches ChartBackgroundColor
Text too long for center area
Solutions:
Set ChartType = "doughnut"
Increase CutoutPercentage to 50-70
Verify ForegroundColor contrasts with background
Shorten CenterText to under 10 characters
Check center text font sizing with larger component
Legend Not Displaying
Possible Causes:
ShowLegend set to false
Component width insufficient for legend (< 250px)
All segments have value 0 (nothing to display)
Solutions:
Set ShowLegend = true
Increase component width to accommodate legend (recommend 400+ pixels)
Verify at least one segment has value > 0
Check ForegroundColor for legend text visibility
Percentages Not Showing in Legend
Possible Causes:
ShowPercentages set to false
Total of all segments is 0
Solutions:
Set ShowPercentages = true
Ensure at least one segment has non-zero value
Verify percentage display updates after data changes
Colors Not Displaying Correctly
Possible Causes:
Invalid ARGB color values
Alpha channel set to transparent (00)
Color values outside valid 32-bit integer range
Solutions:
Verify color values are valid 32-bit signed integers
Ensure alpha channel is FF (255) for full opacity
Test with known reference colors (e.g., 4294967295 for white)
Use color picker tool in WinCC Unified for correct format
Check for proper ARGB format: 0xAARRGGBB
Performance Issues or Slow Updates
Possible Causes:
Update frequency too high (< 100ms intervals)
Multiple properties updated separately instead of batch
Chart rebuilt unnecessarily due to ChartType changes
Solutions:
Reduce update frequency to 500-1000ms intervals
Batch property updates when possible
Avoid changing ChartType during runtime (triggers rebuild)
Monitor system performance during peak usage
Limit number of chart components per screen (recommend < 6)
Segments Appearing in Wrong Order
Issue: Segments display in unexpected sequence
Explanation: Chart.js renders segments in clockwise order starting from top (12 o'clock position), using segments 1-8 in numerical order where value > 0
Solution: Arrange your data in desired display order using Segment1 through Segment8 properties sequentially
Segment Too Small to See
Possible Causes:
Segment value very small compared to total (< 2%)
Too many segments competing for space
Solutions:
Combine small segments into "Other" category
Reduce total number of visible segments
Increase component size for better resolution
Consider filtering out segments below threshold percentage