Duplicated
Last Updated: 26 Jan 2023 11:16 by ADMIN
Alexandre
Created on: 19 Jan 2023 16:27
Category: StockChart
Type: Feature Request
1
How to change StockChartValuesAxisLabel format on TelerikStockChart

Hello Telerik team,

In order to have a the navigation feature on the Chart, I try to use TelerikStockChart with Line and Area series. I have the following code (adapted of your exemple):

https://blazorrepl.telerik.com/QxuvvZbK14tymFOf29
@using TelerikBlazorDemos.DataAccess.Services
@using TelerikBlazorDemos.DataAccess.Dto
@page "/stockchart/overview"
@page "/stockchart/index"

@using System.Collections.Generic

@inject HttpClient http

@if (Data?.Count() > 0)
{
    <TelerikStockChart Width="@Width"
                       Height="@Height"
                       DateField="@nameof(StockDto.Date)">
        <StockChartTitle Text="The Boeing Company NYSE:BA"></StockChartTitle>
        <StockChartTooltip Visible="true"></StockChartTooltip>

        <StockChartSeriesItems>

            <StockChartSeries Type="StockChartSeriesType.Area"
                              Data="@Data"
                              Name="test"
                              Field="@nameof(StockDto.Low)">
            </StockChartSeries>
        </StockChartSeriesItems>

        <StockChartNavigator>
            <StockChartNavigatorSeriesItems>
                <StockChartNavigatorSeries Type="StockChartSeriesType.Line"
                                           Data="@Data"
                                           Field="@nameof(StockDto.High)">
                </StockChartNavigatorSeries>
            </StockChartNavigatorSeriesItems>
        </StockChartNavigator>


        <StockChartValueAxes>
            <StockChartValueAxis Name="test" Max="40">
                <StockChartValueAxisTitle Text="test2" />
                <StockChartValueAxisLabels Background="Yellow"/>
            </StockChartValueAxis>
        </StockChartValueAxes>
    </TelerikStockChart>
}

@code {
    private StockService _stockService;
    private StockService StockService
    {
        get
        {
            if(_stockService == null)
            {
                _stockService = new StockService(http);
            }

            return _stockService;
        }
    }
    public const string Height = "400px";
    public const string Width = "100%";

    IEnumerable<StockDto> Data { get; set; }

    protected override async Task OnInitializedAsync()
    {
        Data = (await StockService.GetStocks()).Take(100);

        await base.OnInitializedAsync();
    }
  
    
}

The problem is the y axis label. I didn't succeded to remove the currency symbol.

I try to change the StockChartValuesAxisLabel format on the TelerikStockChart but the field is not available.

How can i change this format?

Thanks

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
0 comments