Internationalization
14 Mar 20223 minutes to read
Chart provides supports for internationalization for the following chart elements.
- Datalabel.
- Axis label.
- Tooltip.
For more information about number and date 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, date, time values in Chart component using labelFormat
property in axis.
Numeric Format
In the following example axis, point and tooltip labels are globalized to EUR.
<ejs-chart id="container" width="60%" title="Average Sales Comparison">
<e-chart-tooltipsettings enable="true" format="${series.name} <br>${point.x} : ${point.y}"></e-chart-tooltipsettings>
<e-chart-primaryxaxis title="Year"></e-chart-primaryxaxis>
<e-chart-primaryyaxis labelFormat="c" title="Sales Amount in Millions"></e-chart-primaryyaxis>
<e-series-collection>
<e-series dataSource="ViewBag.dataSource" xName="x" yName="y" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column" name="Product X"></e-series>
<e-series dataSource="ViewBag.dataSource" xName="x" yName="y1" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column" name="Product Y"></e-series>
</e-series-collection>
</ejs-chart>
public ActionResult Index()
{
List<InternalChartData> chartData = new List<InternalChartData>
{
new InternalChartData {x= 1900, y= 4, y1= 2.6 },
new InternalChartData{ x= 1920, y= 3.0, y1= 2.8 },
new InternalChartData{ x= 1940, y= 3.8, y1= 2.6},
new InternalChartData{ x= 1960, y= 3.4, y1= 3 },
new InternalChartData{ x= 1980, y= 3.2, y1= 3.6 },
new InternalChartData{ x= 2000, y= 3.9, y1= 3 }
};
ViewBag.dataSource = chartData;
return View();
}
public class InternalChartData
{
public double x;
public double y;
public double y1;
}