BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hello,
I am using the Heatmap component at my project to visualize some data and when this data is edited I want to refresh the Heatmap.
So i would like to ask which one of the Heatmap events is triggered when the Heatmap's datasource changes because neither OnLoad, Loaded or Created event are triggered in my project.
Thanks in advance!
Hi Amanda,
The HeatMap component do not support any events when the data is updated in the component. However, we can dynamically change the data source in the HeatMap component by changing the data set in "DataSource" property and by calling the “StateHasChanged” function. Please find the code snippet for the same below.
Code Snippet:
<SfHeatMap DataSource="@Data"></SfHeatMap>
<button class="btn btn-primary" @onclick="ChangeDataSource">Click me</button>
private void ChangeDataSource() { Data = Data2; InvokeAsync(StateHasChanged); } class HeatmapData { public string RowId { get; set; } public string ColumnId { get; set; } public string Value { get; set; } }
static HeatmapData[] Data2 = new HeatmapData[] { new HeatmapData { RowId= "France", ColumnId= "2008", Value= "74.4" }, //.. }; static HeatmapData[] Data1 = new HeatmapData[] { new HeatmapData { RowId= "China", ColumnId= "2008", Value= "55.6" }, //.. }; |
You can find the sample and video for your reference from the below link.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/HeatMapChart-1151019728
Video: https://www.syncfusion.com/downloads/support/directtrac/general/ze/heatmap1709024952
Please let us know if you need any further assistance.
Regards,
Indumathi R.
Hello and thanks for yor response,
I would like to suggest you to add an event that will be triggered every time the datasource is updated because it would be really helpful especially when the update of the datasource is executed by SignalR.
Thanks in advance!
Hi Amanda,
In general, the data source is added, and new or updated data sources are passed completely from your end to the application level. In such a case, it is you who can recognize and notify the data source update at the application level, and we cannot initiate the event on the component side. However, we would like to suggest a data type called "ObservableCollection" This data type is similar to the list type and also supports event triggering. Please see the documentation below for more information.
Please let us know what type of data you intend to use in the HeatMap data source in your application. It will aid us in analyzing and assisting you further.