Skip to content

[graphics] auto colors in TMultiGraph and THStack - #23332

Open
linev wants to merge 7 commits into
root-project:masterfrom
linev:mgraph_build
Open

[graphics] auto colors in TMultiGraph and THStack#23332
linev wants to merge 7 commits into
root-project:masterfrom
linev:mgraph_build

Conversation

@linev

@linev linev commented Sep 10, 2026

Copy link
Copy Markdown
Member

Both classes support "PFC", "PLC" and "PMC" draw option to assign auto-colors to histograms and graphs.

THStack provides BuildPrimitives method to handle autocolors without painting.
Now also TMultiGraph::BuildPrimitives() will be implemented - to let assign autocolors in TWebCanvas

Improve code around "PFC", "PLC" and "PMC" options analysis in THStack and TMultiGraph. Use TString instead of plain character manipulations.

Improve TPad::IncrementPaletteColor() method. Change signature to const TString &, always convert to lower case to avoid any case mismatch

Fix THStack::GetMinimum()/GetMaximum() methods while option string may contain "e" symbols from other draw option.

Update TWebCanvas and JSROOT to work with new autocolor functionality in TMultiGraph,
This let avoid several workarounds in the JavaScript code

Use `const TString &opt` as argument instead of `TString opt`. This allows to remove "hide" TString include and allow provide const args.
In the function change to lower case to be independent from upper/lower case of provided args
Like in the THStack class, let prepare TGraph objects for painting without real paint.
This required by TWebCanvas to have similar handling of THStack and TMultiGraph classes
Sync autocolor handling with new implementation in TMultiGraph
These methods depends from option decoding. But "e" draw option can only be detected after other options like "same" are excluded.
Make code around option usage more clear,
do not forget use ToLower when used default option
1. Adjust automatic colors handling in `THStack` and `TMultiGraph`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant