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

add wrapper code for appendSeries #457

Merged
merged 3 commits into from May 13, 2024
Merged

Conversation

technyon
Copy link

@technyon technyon commented May 8, 2024

Expose apex charts appendSeries method in C# code

jan-ole.schuemann@alstomgroup.com added 2 commits May 8, 2024 12:12
@joadan
Copy link
Member

joadan commented May 8, 2024

Hi,

Thank you

Do you have a description of this pull request?
No sure how the changes to the realtime sample connects to the append series.

@technyon
Copy link
Author

technyon commented May 8, 2024

I've added a description.

RealTime.razor was just VS formatting things it shoudn't.

@joadan
Copy link
Member

joadan commented May 8, 2024

Sorry if I'm missing something here but adding series dynamically should be preformed using the razor syntax, like example https://apexcharts.github.io/Blazor-ApexCharts/features/dynamic-series

By adding it in code there is a mismatch between the two.

@technyon
Copy link
Author

technyon commented May 8, 2024

I believe in that example it works because after adding the series you call

await chart?.UpdateSeriesAsync(true);

In this chart it's ok because it's static data. In a realtime line chart, calling UpdateSeriesAsync will cause animations to trigger and the data to be reset. I'm honestly just trying to figure out how things are supposed to be done, because they are documented for specific cases only.

I need:

  • a realtime chart
  • with zoom, panning and so on
  • and the ability to add series dynamically

So far it works, but I have a feeling apex charts isn't made for realtime data. Still many quirk when it comes to dynamic data, unfortunately I didn't find a better alternative so far.

@technyon technyon closed this May 8, 2024
@technyon technyon reopened this May 8, 2024
@aoun-muhammad
Copy link

Yeah one thing that found in realtime charts is that you can not use the toolbar, which means you can no do interactive zooming and panning.
I don't know if there is any plan around this thing because that will be super useful.

@technyon
Copy link
Author

You can actually, but it's tricky. Instead of setting the range, every time after appending data to the chart you call c. Then detect via OnZoomed and OnScrolled events if the user is zooming or panning, and suppress calls to ZoomXAsync during this time.

I have actually opened an issue about this at apex charts, all of this should be handled internally by the chart:

apexcharts/apexcharts.js#4423

I'm not too optimistic anything will happen there soon though.

@joadan
Copy link
Member

joadan commented May 13, 2024

@technyon, Thank you I now understand the issue. I'll merge this.

@joadan joadan merged commit da42489 into apexcharts:master May 13, 2024
6 checks passed
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.

None yet

3 participants