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

Dynamically Set Geometry Path for a Series #410

Closed
langejay opened this issue Feb 28, 2022 · 7 comments · Fixed by #1134
Closed

Dynamically Set Geometry Path for a Series #410

langejay opened this issue Feb 28, 2022 · 7 comments · Fixed by #1134
Labels
enhancement New feature or request new feature priority 0 needs to be fixed asap.

Comments

@langejay
Copy link

Is your feature request related to a problem? Please describe.
Ability to set the SVGPath or the SKPath Dynamically and not defined exclusively in the 'MyGeometry' Class.

Describe the solution you'd like
Our solution allows users to dynamically change the graph type and geometry (and colours line thickness etc). There is the ability to set the GeometryFill and GeometryStroke and GeometrySize.

A VERY WELCOMED :-) addition would be to set the Path or SKPath object for a series. This will allow changes to the shape of the geometry dynamically.

Describe alternatives you've considered
We have tried to use the current solution provided, however using a static variable will change the geometry for ALL series.

We could resolve this by creating a template for every eventuality, but this would make our code quite unruly with unrealistic cases to manage throughout our development.

if(line && circle) series = new LineSeries<ObservablePoint,MyCircle>
else if(line && square) series = new LineSeries<ObservablePoint,MySquare>
else if(line && cross) series = new LineSeries<ObservablePoint,MyCross>
...
else if(lineArea && circle) = new LineAreaSeries<ObservablePoint,MyCircle>
...

And that is JUST the creation of a series...

Additional context

@beto-rodriguez beto-rodriguez added enhancement New feature or request new feature labels Apr 26, 2022
@beto-rodriguez beto-rodriguez added the priority 1 might not be fixed in the next release of the library, but it will soon! label Mar 2, 2023
@beto-rodriguez beto-rodriguez added priority 0 needs to be fixed asap. and removed priority 1 might not be fixed in the next release of the library, but it will soon! labels Jun 4, 2023
@Zottel92
Copy link
Contributor

Zottel92 commented Jul 18, 2023

Hi,

thank you for your work on this library.

i am using the newest beta800 version but I still do not get how to map series to svg paths without creating mutliple classes.

I might be to dumb, but since the introduced path function has to be static and the OnDraw call gives no reference to the series itself there is no real way to map these two values.

So the only possibility seems still to create multiple classes for all cases.

I hope I don't miss something obvious.

Best regards

@beto-rodriguez
Copy link
Owner

Hi @Zottel92

The web site needs to update the image, but the article is updated:

https://lvcharts.com/docs/WPF/2.0.0-beta.850/samples.lines.custom

In that sample, the geometry is changed when you click on a point.

@Zottel92
Copy link
Contributor

Zottel92 commented Jul 18, 2023

Hi @beto-rodriguez

thanks for the quick reply.

(sorry that I wrote the wrong version in the first answer, i use 2.0.0-beta.850)

I saw that example-page and also have run the example code on my machine.
But I still do not get how I can have mutliple Series with different Geometries.
And then only update one instead of all of them.

Example:
I have a list of n series shown and want to the user to be able to edit only the geometry of series x to be a star instead of a heart, but the others should stay in heart shape.

Best regards

@Zottel92
Copy link
Contributor

Zottel92 commented Jul 20, 2023

For my Problem I now create a new Geometry Class at runtime for every Series via TypeBuilder
These GeometryTypes are then saved into an array and their static Property is then edited by the user via.

ScatterGeometryType.GetProperty("SelectedPath")?.SetValue(null, SVGPoints.Diamond);

But that is not optimal and ugly.

So the possibility to edit the Geometry on a Series Level would be very desirable.
Would it make sense to reopen this issue? Or should I create a new Issue for this feature?

Best regards

@beto-rodriguez
Copy link
Owner

I think we can simplify this.

@beto-rodriguez
Copy link
Owner

This is already included in beta.900, here is an example:

https://github.com/beto-rodriguez/LiveCharts2/blob/master/samples/ViewModelsSamples/Lines/Custom/ViewModel.cs#L32

@Zottel92
Copy link
Contributor

Zottel92 commented Aug 1, 2023

Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new feature priority 0 needs to be fixed asap.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants