It would be nice to make the label container less than the width of the element so that it stands out more.
I know that it can be set to different colors and transparent but adjusting the width would be a nice addition as well.
Hi Mark,
Thanks for your interest in the feature.
Sharing your insights is always appreciated.
Regards,
Hristian Stefanov
Progress Telerik
Hi Mark,
Thank you for your effort in creating an example to illustrate a possible use-case.Regards,
Hristian Stefanov
Progress Telerik
As a possible use case for this feature. We find that our charts move and shift their layout a lot depending on the length of our axis label text and our desired rotation. It would be excellent if we could provide a template that would allow us to control the axis labels size explicitly.
Hi Bryon,
I renamed this request to something that can be implemented - a visual template for the label that will let you define all aspects (such as colors, backgrounds, sizes and so on). Here's how this works in Kendo, for example: https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/chart/configuration/series.labels.visual (see the rect field) and the charting will in Blazor will have similar behavior.
The series label element width depends a lot on the type of series and thus it cannot be exposed as a configuration option as-is. Consider the following example for this - while in a Column series the label is as wide as the column, a bar or a line series cannot have the same behavior (in the bar chart the height of the label depends on the bar size):
<TelerikChart>
<ChartSeriesItems>
<ChartSeries Type="ChartSeriesType.Bar" Name="Product 2" Data="@series2Data">
<ChartSeriesStack Enabled="true"></ChartSeriesStack>
<ChartSeriesLabels Position="ChartSeriesLabelsPosition.Top" Visible="true" Font="Bold" Background="red">
<ChartSeriesLabelsMargin Left="30" Right="30"></ChartSeriesLabelsMargin>
</ChartSeriesLabels>
</ChartSeries>
<ChartSeries Type="ChartSeriesType.Line" Name="Product 1" Data="@series1Data">
<ChartSeriesStack Enabled="true"></ChartSeriesStack>
<ChartSeriesLabels Position="ChartSeriesLabelsPosition.Above" Visible="true" Font="bold 16px Times New Roman" Background="red"></ChartSeriesLabels>
</ChartSeries>
</ChartSeriesItems>
<ChartCategoryAxes>
<ChartCategoryAxis Categories="@xAxisItems"></ChartCategoryAxis>
</ChartCategoryAxes>
<ChartTitle Text="Quarterly revenue per product"></ChartTitle>
<ChartLegend Position="ChartLegendPosition.Right">
</ChartLegend>
</TelerikChart>
@code {
public List<object> series1Data = new List<object>() { 10, 2, 5, 6 };
public List<object> series2Data = new List<object>() { 5, 8, 2, 7 };
public List<object> series3Data = new List<object>() { 15, 3, 8, 8 };
public string[] xAxisItems = new string[] { "Q1", "Q2", "Q3", "Q4" };
}
Regards,
Marin Bratanov
Progress Telerik