Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify miniatures #1660

Merged
merged 8 commits into from
Oct 20, 2024
Merged

Simplify miniatures #1660

merged 8 commits into from
Oct 20, 2024

Conversation

beto-rodriguez
Copy link
Owner

@beto-rodriguez beto-rodriguez commented Oct 20, 2024

The shape of the series shown in legends/tooltips uses an old api, now the library has better ways to handle that.

This PR updates the library and uses VisualElements to define the shapes in the miniature geommetry in tooltips/legends.

It also fixes:

That issue has caused confusion in the library, like #1507, #913

On older versions, VisualElements were not as
flexible as they are now, lets uses Visuals that are
much easier to render the series miniatues.
The `GetMiniaturesSketch` method has been marked as obsolete in several classes, including `BarSeries`, `CoreBoxSeries`, `CoreFinancialSeries`, `CoreHeatSeries`, `CoreLineSeries`, `CorePieSeries`, `CorePolarLineSeries`, `CoreScatterSeries`, `CoreStepLineSeries`, and `Series`.
Introduce GetMiniature method in BarSeries, CoreBoxSeries, CoreFinancialSeries, CoreHeatSeries, CoreLineSeries, CorePieSeries, CorePolarLineSeries, CoreScatterSeries, and CoreStepLineSeries. This method returns a GeometryVisual object with properties like Fill, Stroke, Width, and Height for visual representation in UI elements.
Replaced `GetMiniaturesSketch().AsDrawnControl(s_zIndex)` with
`GetMiniature(s_zIndex)` across multiple files for consistency
and clarity. This change affects the `CustomLegend`, `CustomTooltip`,
`SKDefaultLegend`, and `SKDefaultTooltip` classes.

- In `CustomLegend.cs`, replaced the commented-out
  `series.GetMiniature(s_zIndex)` with `GetMiniature(s_zIndex)`.
- In `CustomTooltip.cs`, replaced the removed
  `GetMiniaturesSketch().AsDrawnControl(s_zIndex)` with
  `GetMiniature(s_zIndex)`.
- In `SKDefaultLegend.cs`, replaced
  `GetMiniaturesSketch().AsDrawnControl(s_zIndex)` with
  `GetMiniature(s_zIndex)`.
- In `SKDefaultTooltip.cs`, replaced
  `GetMiniaturesSketch().AsDrawnControl(s_zIndex)` with
  `GetMiniature(s_zIndex)`.
@beto-rodriguez beto-rodriguez merged commit 6020265 into dev Oct 20, 2024
4 checks passed
@beto-rodriguez beto-rodriguez deleted the simplify-miniatures branch October 20, 2024 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant