Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
First, you need to define a class ChartChineseSettings that inherits from ChartGlobalizationSettings.
Then, by rewriting the related functions, you can set the text of the chart elements in your own language.
Code example:
In this step, you will use the class ChartChineseSettings you defined in the previous step.
Code example:
Workbook wb = new Workbook("Chinese.xls");
wb.Settings.GlobalizationSettings.ChartSettings = new ChartChineseSettings();
Chart chart0 = wb.Worksheets[0].Charts[0];
chart0.ToImage("Output.png");
Then you can see the effect in the output image: the chart elements will be rendered according to your settings.
If you do not set the Chinese region for a chart, the following chart elements may be rendered in the default language, such as English.
After the above operation, you can obtain an output chart image with Chinese region settings.
| Supported elements | Value in this example | Default value in the English environment |
|---|---|---|
| Axis Title Name | 坐标轴标题 | Axis Title |
| Axis Unit Name | 百,千… | Hundreds, Thousands… |
| Chart Title Name | 图表标题 | Chart Title |
| Legend Increase Name | 增加 | Increase |
| Legend Decrease Name | 减少 | Decrease |
| Legend Total Name | 汇总 | Total |
| Other Name | 其他 | Other |
| Series Name | 系列 | Series |
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.