Chinease, Japanese, Arabic, Russian

This sample uses C# 13 preview features such as partial properties, it also uses features from the CommunityToolkit.Mvvm package, you can learn more about it here.

This web site wraps every sample using a ContentPage instance, but LiveCharts controls can be used inside any container.

sample image

View model

using System;

namespace ViewModelsSamples.Axes.LabelsFormat2;

public class ViewModel
{
    public double[] Values1 { get; set; } =
        [426, 583, 104];

    public double[] Values2 { get; set; } =
        [200, 558, 458];

    public string[] Labels { get; set; } =
        ["王", "赵", "张"];

    public Func<double, string> Labeler { get; set; } =
        value => value.ToString("C2");

}

XAML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
    x:Class="MauiSample.Axes.LabelsFormat2.View"
    xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
    xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui"
    xmlns:vms="clr-namespace:ViewModelsSamples.Axes.LabelsFormat2;assembly=ViewModelsSamples"
    x:DataType="vms:ViewModel">

    <ContentPage.BindingContext>
        <vms:ViewModel/>
    </ContentPage.BindingContext>

    <lvc:CartesianChart>

        <lvc:CartesianChart.Series>
            <lvc:SeriesCollection>
                <lvc:XamlColumnSeries
                    Values="{Binding Values1}"/>
                <lvc:XamlColumnSeries
                    Values="{Binding Values2}"
                    Fill="{x:Null}"/>
            </lvc:SeriesCollection>
        </lvc:CartesianChart.Series>

        <lvc:CartesianChart.XAxes>
            <lvc:AxesCollection>
                <lvc:XamlAxis
                    AxisName="Salesman/woman"
                    Labels="{Binding Labels}"/>
            </lvc:AxesCollection>
        </lvc:CartesianChart.XAxes>

        <lvc:CartesianChart.YAxes>
            <lvc:AxesCollection>
                <lvc:XamlAxis
                    AxisName="Sales"
                    NamePadding="0,15"
                    Labeler="{Binding Labeler}"
                    LabelsPaint="{lvc:SolidColorPaint
                        Color='#00f',
                        FontFamily='Times New Roman',
                        FontWeight=ExtraBold,
                        FontWidth=Normal,
                        FontSlant=Italic}"/>
            </lvc:AxesCollection>
        </lvc:CartesianChart.YAxes>

    </lvc:CartesianChart>
</ContentPage>

Articles you might also find useful: