Search results

Internationalization in JavaScript Circular Gauge control

14 Apr 2021 / 1 minute to read

Circular gauge provide supports for internationalization for below gauge elements.

  • Axis label.
  • Tooltip.

For more information about number formatter you can refer internationalization.

Globalization

Globalization is the process of designing and developing a component that works in different cultures/locales. Internationalization library is used to globalize number in CircularGauge component using format property in labelStyle.

Numeric Format

In the below example axis labels are globalized to EUR.

Source
Preview
index.ts
index.html
Copied to clipboard
import { CircularGauge } from '@syncfusion/ej2-circulargauge';
import { loadCldr, L10n, setCulture, setCurrencyCode } from '@syncfusion/ej2-base';
setCulture('de');
setCurrencyCode('EUR');
let gauge: CircularGauge = new CircularGauge({
axes: [{
    labelStyle: {
        position: 'Inside',
        //Label format as currency
        format: 'c'
    }
}]
}, '#element');
Copied to clipboard
<!DOCTYPE html>
<html lang="en">

<head>
    <title>EJ2 Animation</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript UI Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="index.css" rel="stylesheet" />
    <link href="//cdn.syncfusion.com/ej2/ej2-popups/styles/material.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
</head>

<body>
    <div id='loader'>Loading....</div>
    <div id='container'>
        <div id='element'></div>
    </div>
</body>

</html>