SfHeatMap: Better support for updating the data later on

The samples in the documentation all rely on all data being 1) fixed, and 2) available ahead of time.

For my use case, I need to be able to update existing cells. It would've been nice to know ahead of time that the control isn't really design for this use. :-)

In my case, what I'd like is for both the ItemsMapping (a CellMapping, in this case) and the ColorMapping to be ObservableCollection<T>s. This doesn't currently (as of 19.1) work well for multiple reasons, including:

* if the ItemsMapping is initially empty, I get a NullReferenceException because the control is trying to figure out the item type from the first item (which doesn't exist), rather than the generic parameter. So, I give it a dummy item.
* however, if the column/row of this dummy item doesn't exist in the final, 'real' collection, the heatmap will now continue to show that column/row. There only seems to be code for adding data, not updating or removing it. So, I have to force the heatmap to recreate its internal structures from scratch (I haven't figured out how to do this without reflection).
* similarly, it seems that the ColorMapping is only fully taken into consideration once. For example, if I first set the ColorMappingCollection to a range from 0 to 500, and then set it to 0 to 600, the HeatMapLegend still shows 500 as the max label. Again, I have to force the heatmaplegend to recreate its internal structures from scratch (I haven't figured out how to do this without reflection).
* the ColorMapping class has a Label property, but this doesn't seem to take any effect whatsoever.

Ideally, both the heatmap and its legend should listen to changes to the collections, and dynamically adapt. Failing that, even just public methods to explicitly reinit them would be helpful.

3 Replies

KR Karkuvel Rajan Shanmugavel Syncfusion Team May 3, 2021 11:44 AM UTC

Hi Soeren, 
 
Thanks for contacting Syncfusion support. 
 
Requirement: Need to update ItemSource and ColorMapping collection at runtime. 
 
Currently, In our SfHeatMap control we don’t have support to achieve your requirement. We have added it to our feature request list, but we don’t have any immediate plans to implement this feature. At the planning stage for every release cycle, we review all open features. We will let you know when this feature is implemented. The status of implementation can be tracked through our Feedback portal.  
  
 
Regards, 
Karkuvel Rajan S 



TA tanjaslaton replied to Karkuvel Rajan Shanmugavel May 7, 2021 08:04 AM UTC

Hi Soeren, 
 
Thanks for contacting Syncfusion support. 
 
Requirement: Need to update ItemSource and ColorMapping collection at runtime. 
 
Currently, In our SfHeatMap control we don’t have support to achieve your requirement. We have added it to our feature request list, but we don’t have any immediate plans to implement this feature. At the planning stage for every release cycle, we review all open features. We will let you know when this feature is implemented. The status of implementation can be tracked through our Feedback portal.  
  
five nights at freddy's
 
Regards, 
Karkuvel Rajan S 


Thanks! This makes sense.


PP Prakash Perumal Syncfusion Team May 10, 2021 10:53 AM UTC

Hi Soeren, 
 
Most welcome, let us know if need any other assistance. 
 
Regards, 
Prakash P 


Loader.
Up arrow icon