diff --git a/docs/examples/locale.md b/docs/examples/locale.md new file mode 100644 index 0000000..f350772 --- /dev/null +++ b/docs/examples/locale.md @@ -0,0 +1,49 @@ +--- +title: Locale +order: 8 +--- + +## Locale + +```tsx +import React from 'react'; +import ReactECharts from 'echarts-for-react'; + +import "echarts/i18n/langFR"; + +const Page: React.FC = () => { + const option = { + title: { + text: 'ECharts 入门示例' + }, + toolbox: { + feature: { + saveAsImage: {}, + dataZoom: {}, + restore: {} + } + }, + tooltip: {}, + legend: { + data:['销量'] + }, + xAxis: { + data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'] + }, + yAxis: {}, + series: [{ + name: '销量', + type: 'line', + data: [5, 20, 36, 10, 10, 20] + }] + }; + + return ; +}; + +export default Page; +``` diff --git a/src/types.ts b/src/types.ts index 7b8bd1a..6876863 100644 --- a/src/types.ts +++ b/src/types.ts @@ -9,6 +9,7 @@ export type Opts = { readonly renderer?: 'canvas' | 'svg'; readonly width?: number | null | undefined | 'auto'; readonly height?: number | null | undefined | 'auto'; + readonly locale?: string; }; export type EChartsReactProps = {