diff --git a/packages/charts/src/Line/demo/auto-fit.tsx b/packages/charts/src/Line/demo/auto-fit.tsx
new file mode 100644
index 000000000..81b1eca78
--- /dev/null
+++ b/packages/charts/src/Line/demo/auto-fit.tsx
@@ -0,0 +1,36 @@
+import React, { useState, useEffect } from 'react';
+import { Line } from '@oceanbase/charts';
+
+export default () => {
+ const [data, setData] = useState([]);
+ const asyncFetch = () => {
+ fetch('https://gw.alipayobjects.com/os/bmw-prod/55424a73-7cb8-4f79-b60d-3ab627ac5698.json')
+ .then(response => response.json())
+ .then(json => setData(json))
+ .catch(error => {
+ console.log('fetch data failed', error);
+ });
+ };
+ useEffect(() => {
+ asyncFetch();
+ }, []);
+ const config = {
+ data,
+ xField: 'year',
+ yField: 'value',
+ seriesField: 'category',
+ xAxis: {
+ type: 'time',
+ },
+ yAxis: {
+ label: {
+ // 数值格式化为千分位
+ formatter: v => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, s => `${s},`),
+ },
+ },
+ style: {
+ height: '50vh',
+ },
+ };
+ return ;
+};
diff --git a/packages/charts/src/Line/index.md b/packages/charts/src/Line/index.md
index 857d6bce5..149dc8eed 100644
--- a/packages/charts/src/Line/index.md
+++ b/packages/charts/src/Line/index.md
@@ -13,6 +13,8 @@ nav:
+
+
## API