Need More Info
Last Updated: 19 Mar 2022 14:17 by ADMIN
Adam
Created on: 10 Mar 2022 07:04
Category: UI for Blazor
Type: Bug Report
0
Chart tooltip location is incorrect

Hi, we are using a tile layout for charts and are having an issue where the tooltips for the second row of tiles are appearing at the bottom of the screen away from the chart or not at all. Then when we scroll back to the first row of tiles the tool tips are out of alignment as well. The following screen shot shows an example.

 

We have a component that has a tab strip and the tile layout with the following code

<TabStripTab Title="@tabName">
	@((MarkupString)tabHeading)
				
	<TelerikTileLayout Columns="6"
						RowHeight="225px"
						ColumnWidth="285px"
						Reorderable="true"
						Resizable="true"
						OnResize="@ItemResize"
						OnReorder="@ItemReorder"
						@ref="@TileLayout">
		<TileLayoutItems>
			@foreach (CustomChartViewModel chart in tab.Charts)
			{
				int colSpan = 2;
				int rowSpan = 2;

				<TileLayoutItem RowSpan="@rowSpan" ColSpan="@colSpan">
					<HeaderTemplate>
						<div style="text-align: right">
							<TelerikButton OnClick="@(() => onDeleteChart(chart.Id, tab.Id))">X</TelerikButton>
						</div>
					</HeaderTemplate>	
					<Content>
						<ChartComponent ViewModel="@chart" @ref="@charts[chart.Id]" />
					</Content>
				</TileLayoutItem>
			}
		</TileLayoutItems>
	</TelerikTileLayout>
</TabStripTab>

And then a chart component that renders the individual charts with a tooltip


<TelerikChart @ref="@ChartRef" Height="100%" Width="100%" OnSeriesClick="@OnSeriesClickHandler">
	<ChartTooltip Visible="true">
		<Template>
			<TelerikIcon Icon="information" />
                    @(context.Percentage.ToString("P", nfi))<br />
					@((context.DataItem as MyDataModel).toolTip)
		</Template>
	</ChartTooltip>
	<ChartSeriesItems>
		<ChartSeries Type="ChartSeriesType.Donut" Data="@Data" Field="value" CategoryField="category" ColorField="color">
			<ChartSeriesLabels Position="ChartSeriesLabelsPosition.OutsideEnd"
							   Visible="@ViewModel.ShowLabels"
							   Background="transparent"
							   Template="#= category #: #= value#">
			</ChartSeriesLabels>
		</ChartSeries>
	</ChartSeriesItems>

	<ChartTitle Text="@ViewModel.Name"></ChartTitle>

	<ChartLegend Position="ChartLegendPosition.Bottom" Visible="@ViewModel.ShowLegend"></ChartLegend>
</TelerikChart>

3 comments
ADMIN
Marin Bratanov
Posted on: 19 Mar 2022 14:17

Hello Adam,

Could you send me a simple reproducible I can take a look at? I'm having a hard time reproducing this particular issues and while I am rather certain it is something in the layout, it will likely be easier to find it in yours if you can send it to me, than try to guess exactly what I need to do in a project that normally works well. I'm asking, because I'd rather write a more generic article that is applicable for more scenarios, and I am not sure that CSS hack is the best solution going forward.

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Adam
Posted on: 15 Mar 2022 04:54

Hi Martin,

Your suspicion was spot on. We added the following to the parent component and it resolved the issue.

.k-animation-container.telerik-blazor {
    position: absolute !important;
}

 

A troubleshooting article sounds good.

Thanks,

Adam

ADMIN
Marin Bratanov
Posted on: 12 Mar 2022 19:32

Hi Adam,

Could you take a look at the sample project and its readme that I will link below? It describes a slightly different issue, but the core of the situation may likely be the same - the scrolling container is offset from the content and this causes confusion and issues with popups due to their place of rendering.

link: https://github.com/telerik/blazor-ui/tree/master/common/popup-causes-scroll

So, could you try to ensure the scrolling container is low enough (within the TelerikRootComponent), and see if this helps?

If not, could you post a small runnable sample (maybe in REPL) to showcase the issue?

If it helps, i would appreciate your feedback, as I am thinking such behavior should be documented in some troubleshooting article, but I need to confirm my guess first.

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.