# Copyright (c) 2025-2026 Gigasoft, Inc. All rights reserved. === ProEssentials Pego (knowledge rev 4.2) (Graph Object) Patterns === Pego is the standard Graph Object for categorical/sequential X-axis charts. Bar, line, area, OHLC, ribbon, and more. ALWAYS query pe_query.py for exact paths -- this file provides conceptual understanding only. CRITICAL -- PLOTTING METHOD ENUM: Pego uses GraphPlottingMethod (NOT SGraphPlottingMethod or others). Pego1.PePlot.Method = GraphPlottingMethod.Bar; The enum has 27 values including: Line(0), Bar(1), Point(2), Area(3), AreaStacked(4), BarStacked(6), PointsPlusSpline(12), Spline(13), Histogram(14), PointsPlusLine(16), HorizontalBar(17), Step(20), Ribbon(21), DemographicPyramid(24), SplineArea(25), SplineRibbon(26). Query: pe_query.py enum "GraphPlottingMethod" WARNING: Integer values differ from SGraphPlottingMethod. For example, Point=2 in GraphPlottingMethod but Point=1 in SGraphPlottingMethod. Using the wrong enum produces silent runtime bugs. X-AXIS DATA MODEL: Pego X-axis is categorical/sequential -- no PeData.X array needed. PeData.Points = number of categories along X-axis. PeString.PointLabels[p] = category labels (e.g., months, names). PeString.PointLabelsII[row, col] = multi-row hierarchical labels. See pe-pointlabelsII knowledge file for full details. Data goes in PeData.Y[subset, point] only. FLOATING STACKED BARS (Example 025): PeData.Z defines a floating baseline for stacked bar charts. Instead of stacking from zero, bars float above Z values. Three requirements: 1) PePlot.Method = GraphPlottingMethod.BarStacked (or HorizontalStackedBar) 2) PePlot.Option.FloatingStackedBars = true 3) PeData.Z[0, p] populated with baseline values for each point Z data only needs subset 0 -- it defines where the entire stack floats from. Works for both vertical BarStacked and HorizontalStackedBar methods. Use PePlot.Allow.HorzBarStacked = true to let users switch to horizontal via popup menu. PeGrid.InFront = true is useful with large stacked bars so grid lines remain visible on top. SUBSET VISIBILITY AND DRAW ORDER: PeData.SubsetsToShow[subsetIndex] = priority (0--9): 0 = hidden, 1--9 = visible, higher values drawn first (behind). Simpler than RandomSubsetsToGraph for basic show/hide. PeData.RandomSubsetsToGraph -- lists explicit subset indices to include. Order of indices controls draw order. Related to ScrollingSubsets. PeTable.SubsetsToTable -- independently controls table row order/visibility. PeLegend.SubsetsToLegend -- independently controls legend order/visibility. These four properties give independent control of plotting, legend, and table ordering. See Example 033 and pe-legends knowledge file. PEGO BASE (Example 000) PROVIDES: 4 subsets x 12 points, Area method, DataShadows, stacked/ribbon allowed, glass bars, gradient areas/splines, DarkNoBorder QuickStyle, BitmapGradient, Large fonts, bold text, dotted grid lines, data table below chart, one-line legend, HorzAndVert zoom, mouse dragging, Direct2D render. KEY: Always query exact paths: pe_query.py enum "GraphPlottingMethod" pe_query.py props "PointLabels,BarWidth,BarGap,FloatingStackedBars"