Hello James,
The default colors (including the default list of series colors) do come from the themes, but you have full control over various colors and styles through the chart properties. Such properties are the way to style a chart, and you need to look for child elements to find styling options.
Usually, the inner tags will contain their parent tag name and add specifics to its end. You can see an example of this with the ChartSeries > ChartSeriesLabels tags.
Here's an example I made for you based on our first sample in the docs. I highlighted the changes
<TelerikChart>
<ChartSeriesItems>
<ChartSeries Type="ChartSeriesType.Line" Name="Product 1 (bound to simple data)" Data="@simpleData">
</ChartSeries>
<ChartSeries Type="ChartSeriesType.Line" Name="Product 2 (bound to model)" Data="@modelData" Field="@nameof(MyDataModel.SecondSeriesValue)">
<ChartSeriesLabels Color="cyan" Font="22px 'Courier New'" Background="transparent" Template="#=value# in #=dataItem.ExtraData# quarter" Visible="true">
<ChartSeriesLabelsBorder Width="3" Color="green" DashType="DashType.LongDashDotDot"></ChartSeriesLabelsBorder>
</ChartSeriesLabels>
</ChartSeries>
</ChartSeriesItems>
<ChartValueAxes>
<ChartValueAxis Color="red"></ChartValueAxis>
</ChartValueAxes>
<ChartCategoryAxes>
<ChartCategoryAxis Categories="@xAxisItems"></ChartCategoryAxis>
</ChartCategoryAxes>
<ChartTitle Text="Quarterly sales trend"></ChartTitle>
<ChartLegend Position="Telerik.Blazor.ChartLegendPosition.Bottom" Background="red">
<ChartLegendLabels Color="blue" Font="10px Verdana">
<ChartLegendLabelsMargin Top="50"></ChartLegendLabelsMargin>
</ChartLegendLabels>
</ChartLegend>
</TelerikChart>
@code {
public class MyDataModel
{
public int SecondSeriesValue { get; set; }
public string ExtraData { get; set; }
}
public List<MyDataModel> modelData = new List<MyDataModel>()
{
new MyDataModel() { SecondSeriesValue = 1, ExtraData = "first" },
new MyDataModel() { SecondSeriesValue = 5, ExtraData = "second" },
new MyDataModel() { SecondSeriesValue = 3, ExtraData = "third" },
new MyDataModel() { SecondSeriesValue = 2, ExtraData = "fourth" },
};
public List<object> simpleData = new List<object>() { 10, 2, 7, 5 };
public string[] xAxisItems = new string[] { "Q1", "Q2", "Q3", "Q4" };
}
Granted, the main background of the chart is now always white, we have not exposed a setting for this yet, but it will become available.
On resizing the chart with the browser - the .Refresh() method the chart exposes does that, you just need to call it from your JS Interop code. I will soon create an example of doing that, in the meantime you can see the general approach here: https://docs.telerik.com/blazor-ui/components/chart/overview#chart-size.
Regards,
Marin Bratanov
Progress Telerik
UI for Blazor