---
ADMIN EDIT
Screen recording attached below, code to reproduce it too.
---
I want horizontal and vertical lines in the chart to act as markers (limits, thresholds). It would be awesome if there was a way to simply draw a horizontal and vertical lines, bound to a collection of y and x data respectively.
Something like the below would be nice
<TelerikChart>
<ChartSeriesItems>
<ChartSeries Type="@ChartSeriesType.Line" Name="@P_Name1" Color="blue"
Data="@P_Data1"
Field="@P_Field1"
CategoryField="@P_CategoryField1">
<ChartSeriesLabels Visible="true" Template="#=dataItem.P_Description#" />
<ChartSeriesMarkers Size="4" />
</ChartSeries>
<ChartHorizontalLines Data="@YLinesData"/>
<ChartVerticalLines Data="@XLinesData"/>
</ChartSeriesItems>
</TelerikChart>
@code{
List<double> YLinesData, XLinesData;
}
---
ADMIN EDIT
You can find some more details and ideas for workarounds here to consider in the meantime.
---
Like in Kendo (here and here) so I can change the cursor for the chart to a pointer when the user hovers the series - I want that to indicate they can click on it (through the SeriesClick event).
---
ADMIN EDIT
workaround that you can consider which uses CSS to traverse the chart rendering:
<style>
/* this will work in the chart below with its settings, axes, title and so on */
.k-chart g[clip-path] g g g path {
cursor: pointer;
}
/* a very generic selector that will capture just about everything in the plot area of the chart */
/* Try this if you cannot make a more specific selector like the one above by inspecting the rendered content */
/*.k-chart path {
cursor: pointer;
}*/
</style>
<TelerikChart>
<ChartSeriesItems>
<ChartSeries Type="ChartSeriesType.Column" Name="Product 1" Data="@series1Data">
</ChartSeries>
<ChartSeries Type="ChartSeriesType.Column" Name="Product 2" Data="@series2Data">
</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 string[] xAxisItems = new string[] { "Q1", "Q2", "Q3", "Q4" };
}
---
When a Chart Series has a click handler defined, I think the cursor should be set to 'pointer' when the user is hovering over the series so the user knows its clickable. Currently the Chart Series Labels change to a pointer cursor when you hover them, however they are not clickable. Not sure if this was the intended functionality, but it seems backwards to me.
Our Site supports multiple themes that we have built using the SASS Theme Builder. For all Telerik Components we have used so far the theme changes on them as expected when using the example found here (Change Theme at Runtime). The problem seems to be the chart component will not adhere to the newly applied theme after its initial load. Seems like this is because it is shown as an SVG with hardcoded attributes on the element. Is there a workaround for this (other than reloading the components entirely)?
Before & After Theme Change:
I would like to be able to control the rendering of the Lines on the X and Y axis for the Chart. For example, I would like to be able to hide them, change their color, etc. Currently, such an option is available for the stock chart with the following nested tags: StockChartCategoryAxisLine and StockChartValueAxisLine.
Hello support team,
from the donut chart example under https://demos.telerik.com/blazor-ui/chart/donut-chart:
Is there a specific reason why all charts have a Template sub-property for the ChartSeriesTooltip construct but the Template field with the template syntax for the ChartSeriesLabels construct? I would favour a unified syntax for both of the properties, if this is possible somehow...
Is this planned for the future to be unified? Especially formatting like shown under https://docs.telerik.com/blazor-ui/knowledge-base/chart-format-percent is not as simple as I would have expected as nobody wants to touch JavaScript code literally :D (Also, localizing data seems quite difficult with that technique).
The best option in my opinion would be to remove those templates completely and just let the user decide what to show there while using a field called e.g. TooltipMappingName and LabelMappingName or something like that. This gives the chart the maximum of configuration possible.
Example:
<TelerikChart>
<ChartTitle Text="What is you favourite sport?"></ChartTitle>
<ChartLegend Visible="true" Position="ChartLegendPosition.Top"></ChartLegend>
<ChartSeriesItems>
<ChartSeries Type="ChartSeriesType.Donut"
Data="@Data"
Field="@nameof(ModelData.Value)"
CategoryField="@nameof(ModelData.Category)">
<ChartSeriesTooltip Visible="true" Context="item" TooltipMappingName="@nameof(ModelData.Tooltip)"/>
<ChartSeriesLabels Position="ChartSeriesLabelsPosition.OutsideEnd"
Visible="true"
Background="transparent"
LabelMappingName="@nameof(ModelData.Label)">
</ChartSeriesLabels>
</ChartSeries>
</ChartSeriesItems>
</TelerikChart>
@code {
public class ModelData
{
public string Category { get; set; }
public int Value { get; set; }
public string Tooltip { get; set; }
public string Label { get; set; }
}
public List<ModelData> Data = new List<ModelData>()
{
new ModelData()
{
Category = "Football",
Value = 35,
Tooltip = "35%",
Label = "Football: 35%"
},
new ModelData()
{
Category = "Basketball",
Value = 25,
Tooltip = "25%",
Label = "Basketball: 25%"
},
new ModelData()
{
Category = "Volleyball",
Value = 20,
Tooltip = "20%",
Label = "Volleyball: 20%"
},
new ModelData()
{
Category = "Rugby",
Value = 10,
Tooltip = "10%",
Label = "Rugby: 10%"
},
new ModelData()
{
Category = "Tennis",
Value = 10,
Tooltip = "10%",
Label = "Tennis: 10%"
}
};
}
Best regards,
Christian
The context DataItem is null for subsequent ChartSeries. It receives the correct object for the first ChartSeries, but for the rest is null.
<Admin Edit>
A workaround, for the time being, would be to remove the Template and let the Tooltip display the default value, which will be correct.
</Admin Edit>
Reproduction code:
<TelerikChart>
<ChartTitle Text="Unrecoverable Errors Per Minute vs. Signal Level" />
<ChartCategoryAxes>
<ChartCategoryAxis Type="@ChartCategoryAxisType.Category" />
</ChartCategoryAxes>
<ChartValueAxes>
<ChartValueAxis>
<ChartValueAxisLabels Visible="true" />
</ChartValueAxis>
</ChartValueAxes>
<ChartTooltip Visible="true">
<Template>
@{
var data = context.DataItem as ModelData;
<div class="card" style="font-size: 0.8rem; color: black">
<span>@($"{data.Value}")</span>
<span>@($"{data.Type}")</span>
</div>
}
</Template>
</ChartTooltip>
<ChartSeriesItems>
<ChartSeries Type="ChartSeriesType.Line"
Data="@ChartData1"
CategoryField="@nameof(ModelData.Type)"
Field="@nameof(ModelData.Value)">
</ChartSeries>
<ChartSeries Type="ChartSeriesType.Line"
Data="@ChartData2"
CategoryField="@nameof(ModelData.Type)"
Field="@nameof(ModelData.Value)">
</ChartSeries>
<ChartSeries Type="ChartSeriesType.Line"
Data="@ChartData3"
CategoryField="@nameof(ModelData.Type)"
Field="@nameof(ModelData.Value)">
</ChartSeries>
</ChartSeriesItems>
</TelerikChart>
@code {
public class ModelData
{
public string Type { get; set; }
public double Value { get; set; }
}
public List<ModelData> ChartData1 = new List<ModelData>() { new ModelData() { Type = "S1", Value = 1 } };
public List<ModelData> ChartData2 = new List<ModelData>() { new ModelData() { Type = "S2", Value = 5 } };
public List<ModelData> ChartData3 = new List<ModelData>() { new ModelData() { Type = "S3", Value = 9 } };
}
When I place a Chart in a small container, for example, a div, the labels are cut off and thus unreadable.
===
ADMIN EDIT
===
A possible workaround for the time being is changing the position of the labels so they are not cut off. For example: https://blazorrepl.telerik.com/mHkNkCEC16hMJnTg26.
I would like to control the font of the Value axis labels in a similar fashion to the way I can control the labels of the category axis:
<ChartCategoryAxes>
<ChartCategoryAxis Categories="@xAxisItems">
<ChartCategoryAxisLabels Font="bold 12px 'Helvetica'"></ChartCategoryAxisLabels>
</ChartCategoryAxis>
</ChartCategoryAxes>
*** Thread created by admin on customer behalf ***
In need a chart that has a shaded area between a max and min set of curves, indicating the allowable area
Like this one: https://demos.telerik.com/kendo-ui/range-area-charts/index