Is it possible to dynamically update HeatMap Axis labels?

Hi, 

I'm having issues with updating the heatmap axis labels. It seems if I update the axis labels and heatmap data at the same time, the axis labels do not update till I update the heatmap data again. 

It's as if refreshing the axis labels is always one step behind. I've shared sample code for a minimal repro below. You will see that if you click the UpdateAxisAndData button, even though I am setting both the heatmap data and axis labels, and calling StateHasChanged, ​the heatmap shows updated data, but not updated axis labels. It's only after clicking the UpdateAxisAndData button a second time that the axis is updated in the UI



@page "/test"


@using Syncfusion.Blazor.HeatMap


<h3>Test</h3>


<button @onclick="@UpdateAxis">Update Axis</button>


<button @onclick="@UpdateAxisAndData">Update Axis And Data</button>


<SfHeatMap DataSource="@HeatMapData" Width=100% Height=90%>
<HeatMapXAxis Labels="@XAxisLabels" OpposedPosition="true"></HeatMapXAxis>
<HeatMapYAxis Labels="@YAxisLabels"></HeatMapYAxis>
<HeatMapLegendSettings Visible=false></HeatMapLegendSettings>
<HeatMapPaletteSettings Type="PaletteType.Gradient">
</HeatMapPaletteSettings>
</SfHeatMap>




@code {
int?[,] HeatMapData = new int?[1, 1] { { 5 } };


string[] XAxisLabels = new string[] { "xAxisLabel" };


string[] YAxisLabels = new string[] { "yAxisLabel" };


void UpdateAxis()
{
XAxisLabels = new string[] { "UpdatedAxis" };
StateHasChanged();
}


void UpdateAxisAndData()
{
XAxisLabels = new string[] { "UpdatedAxisAndData" };
HeatMapData = new int?[1, 1] { { 2 } };
StateHasChanged();
}
}

2 Replies

MK Muthukrishnan Kandasamy Syncfusion Team March 5, 2022 04:31 AM UTC

 
Hi Jamie, 
 
Sorry for the inconvenience. 
 
We have validated your reported problem in Blazor Heatmap component and confirmed this issue as a bug from our end. We will resolve this issue and include the fix in second weekly release after the volume 1 release of 2022. 
 
You can track the status through the below portal link. 
 
 
Regards, 
Muthukrishnan K 



IR Indumathi Ravi Syncfusion Team August 12, 2022 07:23 AM UTC

Hi Jamie,


Thank you for your patience.


We have fixed the reported issue - “The Heatmap axis labels were not updated dynamically
” and included the fix in our latest weekly patch release(v20.2.43). Please update the latest “Syncfusion.Blazor.HeatMap” package in your application to resolve the reported issue. Please find the package link below.


https://www.nuget.org/packages/Syncfusion.Blazor.HeatMap


Please let us know if you need any further assistance.


Regards,

Indumathi R.


Loader.
Up arrow icon