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

Empty collection does not let the plot become invisible #1505

Closed
Daimonion1980 opened this issue May 3, 2024 · 7 comments
Closed

Empty collection does not let the plot become invisible #1505

Daimonion1980 opened this issue May 3, 2024 · 7 comments
Labels
not verified It is probably an issue, but we have not enough evidence to mark this as a bug.

Comments

@Daimonion1980
Copy link

Daimonion1980 commented May 3, 2024

Describe the bug
I have a WPF UserControl which implements a Livecharts BasicLine Plot and is enabled to show one or more graphs. For this I implemented a ObservableCollection and two Axis Lists. (I work with MVVMGen as boilerplate code generator)

[Property] ObservableCollection<ISeries> plotData = [];
[Property] IList<ICartesianAxis> xAxis = [];
[Property] IList<ICartesianAxis> yAxis = [];

Adding entries to this setup works pretty well. The data appears in the UI.
When removing an element (removing the specific entry in PlotData and YAxis) the data disappear in the ui.
But when removing the last entry and clearing all Collections and Lists, so that there Length is zero
the UI held the last element and does not become invisible or collapsed. The label from the entry disappears but coordinates and the last graph is still available.

When adding new Plots to the Collections and Axis Lists the UI is rebuild.

Expected behavior
When the collection is empty, the view shall be invisible.

Screenshots
after adding some data to the collections and lists:
threee Graphs added

After removing (e.g. Plotdata.Clear(), XAxis.Clear(), YAxis.Clear()) all elements from the collections and lists:
Collection empty

@network-interface-controller

Might be related to #1365

@Daimonion1980
Copy link
Author

Yep, didn't found this because of bad search skills... ;)

@beto-rodriguez
Copy link
Owner

Hi @Daimonion1980

I am not able to reproduce this issue, it seems that everything work as expected for me:

clear

Can you please provide a complete and minimal example where I can reproduce the issue?

@network-interface-controller I think that is a different issue, I'l;l reply there with the details.

@beto-rodriguez beto-rodriguez added the not verified It is probably an issue, but we have not enough evidence to mark this as a bug. label Sep 13, 2024
@beto-rodriguez
Copy link
Owner

I will close this for now because Iw as not able to reproduce, but feel free to reply or create a new issue if it persists.

@Daimonion1980
Copy link
Author

Thanks for your response. At the moment I am building an app where I am able to show you this behavior. The original App is to big to show.
I hope to be done this week and will open a new issue or response on this issue when I am not able to reproduce it via this app.

@Daimonion1980
Copy link
Author

Daimonion1980 commented Sep 17, 2024

Okay, so I was able to reproduce it in a small app which you can download here: https://github.com/Daimonion1980/livechartsDemo/tree/main

At first I was not able to reproduce the behavior because I just added PlotData and did not mange the axes manually. But after adding the code to manage the axes and the ScalesYAt Property the last Plot is not removed correctly.
I mentioned the Axes control in #1504

Please check the readme in the repo with the description to see the problem.

If you are not able to reopen this issue I can create a new one.

@beto-rodriguez
Copy link
Owner

Thanks for the repo!

I tried it and yes, I was able to reproduce the issue, this is related with a bug on toggling the series visibility, this is already fixed with #1656 and will be included in the next version of the library.

I will close this for now because this is fixed already in the dev branch and there is a similar issue #1164 where we can track this issue, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not verified It is probably an issue, but we have not enough evidence to mark this as a bug.
Projects
None yet
Development

No branches or pull requests

3 participants