# Copyright (c) 2025-2026 Gigasoft, Inc. All rights reserved. === ProEssentials Pepco (knowledge rev 4.1) (Pie Chart) Patterns === Pepco is the Pie Chart Object. It has unique data conventions and properties that differ significantly from Pego/Pesgo. ALWAYS query pe_query.py for exact paths -- this file provides conceptual understanding only. CRITICAL DATA ARRAY ROLES (DIFFERENT from Pego/Pesgo): PeData.X[s,p] = slice VALUES (determines slice size) PeData.Y[s,p] = slice EXPLOSION state (1=exploded, 0=normal) This is the OPPOSITE of Pego/Pesgo where Y holds data values. Pepco does NOT use PeData.Y for data -- only for explosion control. DATA STRUCTURE: Subsets = produce types, categories, or data series (scrollable) Points = slices in the pie (states, items, segments) PeString.SubsetLabels[s] = category names (e.g., "Apples") PeString.PointLabels[p] = slice labels (e.g., "Texas") PeColor.SubsetColors[0..12] = slice colors (up to 13 for 12 slices + Other) Vertical scrollbar cycles through subsets to show different pies. SLICE EXPLOSION: Programmatic: PeData.Y[subset, point] = 1 -- explodes that slice on render Interactive: PeUserInterface.AutoExplode enum controls user double-click: AutoExplode.None (0) -- no interactive explosion AutoExplode.AllSubsets (1) -- clicking explodes for all subsets AutoExplode.IndividualSubsets (2) -- clicking explodes per-subset only Both coexist -- AutoExplode enables interaction, PeData.Y sets initial state. Visual cue: if only SOME slices are pulled out more, it's programmatic. GROUPING (small slices into "* Other"): PePlot.GroupingPercent enum controls threshold: NoGrouping (0), OnePercent (1), TwoPercent (2), ThreePercent (3), FourPercent (4), FivePercent (5) Slices at or below the threshold get pooled into "* Other" slice. The "* Other" breakdown is listed at the bottom of the chart. 3D SHADOW EFFECTS: PePlot.DataShadows enum: ThreeDimensional -- full 3D depth effect on pie Shadows -- subtler shadow, less depth None -- flat PePlot.Show3DShadow (bool) -- controls drop shadow below the 3D pie true = show drop shadow, false = hide it These two properties work together for the overall 3D appearance. PIE GRADIENT STYLES: PePlot.GradientStyle (PieGradientStyle enum): Curved (0) -- standard curved 3D shading (default) BeveledInset (1) -- inset 3D effect BeveledHighlight (2) -- bright highlight sheen on slice surfaces NoGradient (3) -- flat coloring, no gradient Visual cue: BeveledHighlight has a distinctive bright spot on each slice. PIE LABELS AND LEGEND: PePlot.ShowPieLabels (ShowPieLabels enum): Controls what text appears next to each slice (name, percent, both, etc.) ShowPieLabels.PercentOnly -- shows only percentage PeLegend.ShowPieLegend (bool) -- shows a separate legend box PeLegend.Location -- legend placement (Left, Right, Top, Bottom) SLICE HATCHING: NAMING TRAP: PePlot.SubsetHatch[i] indexes by SLICE (point) in Pepco, NOT by subset. SubsetHatch[0]=first slice, [1]=second slice, etc. (In Pego/Pesgo it indexes by subset as the name suggests.) HatchType enum (all 7 values): NoHatching (0), Horizontal (1), Vertical (2), FDiagonal (3), BDiagonal (4), Cross (5), DiagonalCross (6) PePlot.SliceHatching = SliceHatching enum: Monochrome (0) -- only monochrome slices get hatched MonochromePlusColor (1) -- both monochrome and color slices get hatched PeColor.HatchBackColor -- background color behind hatch lines (use ARGB) Example: Color.FromArgb(255, 230, 230, 230) for light gray See Example 303 for hatching implementation. QUICKSTYLE VISUAL GUIDE FOR PEPCO: DarkNoBorder (12) -- very dark background (base 300 default) MediumShadow (6) -- gray-green/olive mid-tone, shadow border LightShadow (2) -- lighter, near-white with shadow border MediumInset (5) -- medium tone with inset border PEPCO BASE (Example 300) PROVIDES: 5 subsets x 12 points, random data, state/produce labels, DemoColors, GroupingPercent.FourPercent, DataShadows.ThreeDimensional, Show3DShadow=true, AutoExplode.AllSubsets, DarkNoBorder QuickStyle, Large fonts, bold text, Direct2D render, PrepareImages, CacheBmp. KEY EXAMPLES: 300 -- Simple Pie Chart (base) 301 -- Exploded slices (PeData.Y explosion + BeveledHighlight) 302 -- Optional legend (ShowPieLegend, bitmap desk background) 303 -- Hatching (SubsetHatch, SliceHatching) KEY: Always query exact paths: pe_query.py props "GroupingPercent,AutoExplode,Show3DShadow,GradientStyle" pe_query.py enum "PieGradientStyle" pe_query.py enum "AutoExplode" pe_query.py enum "ShowPieLabels"