I found a great example, big thanks to Daniel, link below:link
I also asked on the website, but I also decided to ask here.
I have a few questions:
I need to retrieve data from the database. The data should be refreshed every 1 second. I know that I need to override my
SendVariationData()function for the function that fetches the data from the database. Perhaps we can inject some sort of service that allows the data to be read from the database.I need to create multiple charts and I know I can use one hub (connection) to subscribe to multiple streams.
I want to create multiple line charts to display the months data, so I need 12 charts (one chart for one month).
I don't want to create 12 "Writers" (like
_currencyWriters), maybe it would be better to pass the month parameter (maybe other parameters), and maybe we need aDictionary<string, List<ChannelWriter>list?And also I need to create another chart, for example a bar chart, and pass the parameters needed by the function that provides the data from the database and shows on the chart.
In this situation, can I use only one (maybe static) Hub Connection or maybe create separate connection for each charts?
I don't know exactly how to extend solution. Maybe my way is wrong. Could you please give me some advice and tips?
I'm working on the problem to extend the examples, but I failed, I'm new to .NET Core, Blazor and SignalR.