private ApexChart<TransactionDataResponse> chart = default!;
private readonly ApexChartOptions<TransactionDataResponse> chartOptions = new()
{
Theme = new Theme { Mode = Mode.Dark },
NoData = new NoData { Text = "Loading ..." },
DataLabels = new DataLabels
{
OffsetY = -10,
Background = new DataLabelsBackground { Enabled = false }
},
Yaxis = new List<YAxis> {
Show = false, // do not display the Y axis
Title = new AxisTitle { Text = "Price" },
Labels = new YAxisLabels
{
Formatter = @"function (value) { return Number(value).toLocaleString() + ' €';}"
}
},
Tooltip = new Tooltip
{
X = new TooltipX { Format = "ddd d MMMM yyyy" },
Y = new TooltipY { Formatter = @"function(value, { series, seriesIndex, dataPointIndex, w }) { return value + ' €'; }" }
}
};
protected override async Task OnInitializedAsync()
{
chartOptions.Yaxis = new List<YAxis>
{
new YAxis
{
Show = false,
Title = new AxisTitle { Text = "Price" },
Labels = new YAxisLabels
{
Formatter = @"function (value) { return Number(value).toLocaleString() + ' €';}"
}
}
};
chartOptions.Tooltip = new Tooltip
{
X = new TooltipX
{
Format = "ddd d MMM yyyy"
}
};
// chartOptions.Xaxis = new XAxis
// {
// Labels = new XAxisLabels
// {
// Formatter = @"function (value) {
// if (value === undefined) {return '';}
// return value.toUpperCase();}"
// }
// };
// chartOptions.DataLabels = new DataLabels
// {
// Formatter = @"function(value, opts) { return Number(10).toLocaleString(); }"
// };
}
|