PieChart (and PolarChart) custom legend support (#1489) #1573
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1489
The default
legend
assignment inInitializeCore
was overwriting the user-provided legend. Moving this to the constructor, similar to how thetooltip
is managed, yields the desired results.Example using the Custom Legend example in the
WPFSample
project:Before:
![image](https://private-user-images.githubusercontent.com/5374098/360213850-8744d9f3-394b-4b8d-8d9b-6b5e517253cd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2Nzk2NTIsIm5iZiI6MTczOTY3OTM1MiwicGF0aCI6Ii81Mzc0MDk4LzM2MDIxMzg1MC04NzQ0ZDlmMy0zOTRiLTRiOGQtOGQ5Yi02YjVlNTE3MjUzY2QucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMDQxNTUyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZTg0MmY1N2Q3MmRjZGY0ZmYzMmNmYjIxNWZiZGU1NTNlNDM0YTdjOGViZjc2ZmUzMWVl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