When I am building a custom tooltip in the column series (or any series) how do i get a reference to the data associated with the point under the mouse
<ColumnSeries Name="@series.Name" XAxisName="@series.XAxisName" YAxisName="@series.YAxisName" MarkerType="MarkerType.None" Brush="@series.Brush" Outline="@series.Brush" Thickness="@series.Thickness" DataSource="@series.SeriesData" ValueMemberPath="@series.ValueMemberPath" Title="@series.Title" ShowDefaultTooltip="true" MouseOverEnabled="true"> <TooltipTemplate> <div style="width: 200px; height: 70px;"> <span>How do I reference the data object under the mouse</span> </div> </TooltipTemplate>
Hello,
To access the item you can use this code and use the Context object:
<TooltipTemplate> @{ var data = context.Item as FilmFranchiseInfo; <span> @data.Franchise </span> } </TooltipTemplate>
Now, an alternate way to write a TooltipTemplate is to use SeriesMouseEnterScript event and use JS to write your own template.
tooltip-template.zip