Search results

Internationalization

Chart provide supports for internationalization for below chart elements.

  • Datalabel.
  • Axis label.
  • Tooltip.

Globalization

Globalization is the process of designing and developing an component that works in different cultures/locales. Internationalization library is used to globalize number, date, time values in Chart component using LabelFormat property in axis.

Numeric Format

In the below example axis, point and tooltip labels are globalized to EUR.

number-format.razor
@using Syncfusion.EJ2.Blazor.Charts

<EjsChart Width="60%" Title="Average Sales Comparison">
    <ChartPrimaryXAxis Title="Year"></ChartPrimaryXAxis>

    <ChartPrimaryYAxis LabelFormat="c" Title="Sales Amount in Millions">
    </ChartPrimaryYAxis>

    <ChartTooltipSettings Enable="true" Format="${series.name} <br>${point.x} : ${point.y}">
    </ChartTooltipSettings>

    <ChartSeriesCollection>
        <ChartSeries DataSource="@SalesReports" XName="X" YName="Y" Type="ChartSeriesType.Column" Name="Product X">
            <ChartMarker>
                <ChartDataLabel Visible="true"></ChartDataLabel>
            </ChartMarker>
        </ChartSeries>
        <ChartSeries DataSource="@SalesReports" XName="X" YName="Y1" Type="ChartSeriesType.Column" Name="Product Y">
            <ChartMarker>
                <ChartDataLabel Visible="true"></ChartDataLabel>
            </ChartMarker>
        </ChartSeries>
    </ChartSeriesCollection>
</EjsChart>

@code{
    public class ChartData
    {
        public double X;
        public double Y;
        public double Y1;
    }

    public List<ChartData> SalesReports = new List<ChartData>
  {
         new ChartData {X= 1900, Y= 4, Y1= 2.6 },
         new ChartData{ X= 1920, Y= 3.0, Y1= 2.8 },
         new ChartData{ X= 1940, Y= 3.8, Y1= 2.6},
         new ChartData{ X= 1960, Y= 3.4, Y1= 3 },
         new ChartData{ X= 1980, Y= 3.2, Y1= 3.6 },
         new ChartData{ X= 2000, Y= 3.9, Y1= 3 }
    };
}

Globalization

See Also