We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Use POCO[] instead of double[]

All the examples bind the heatmap to a double[] (or int[]).

Is it possible to instead bind to a POCO[], tell it a numeric property to use, and then display a templated tooltip.

1 Reply

KM Kanagambigai Murugan Syncfusion Team October 28, 2019 11:16 AM UTC

Hi Patrick, 
  
Thanks for contacting Syncfusion. 
  
We have validated your requirement and prepared a sample accordingly. Here, we have rendered the Heatmap by binding it to the “HeatmapData” and used TooltipRendering Event to display the templated tooltip. 
  
<EjsHeatMap DataSource="@Data"> 
        <HeatMapEvents TooltipRendering="@TooltipRendering"></HeatMapEvents> 
 
  
   </EjsHeatMap> 
@code{ 
  
    class HeatmapData 
    { 
        public string RowId { get; set; } 
        public string ColumnId { get; set; } 
        public string Value { get; set; } 
    } 
    HeatmapData[] Data = new HeatmapData[] { 
               new HeatmapData  { RowId= "France", ColumnId= "2010", Value= "77.6" }, 
               new HeatmapData  { RowId= "France", ColumnId= "2011", Value= "79.4" }, 
                
 
} 
public void TooltipRendering(ITooltipEventArgs args) 
    { 
        args.Content = new string[] { "In " + args.YLabel + ", " + args.Value + "M" + " visited " + args.XLabel}; 
    } 
} 
  
  
  
Please check the above sample and get back to us if you need any further assistance. 
  
Regards, 
Kanagambigai M.   


Loader.
Live Chat Icon For mobile
Up arrow icon