Skip to content

Commit

Permalink
📖 [docs] Add example usage of allowDataOverflow (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
benschwarz committed Apr 12, 2024
1 parent 3172c45 commit d69493f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/docs/api/XAxis.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export default {
'zh-CN':
'当轴是数值轴时,指定轴的定义域(domain)的时候,如果 allowDataOverflow 的值为 false,我们会根据数据的最大值和最小值来调整 domain,确保所有的数据能够展示。如果 allowDataOverflow 的值为 true,不会调整 domain ,而是将相应的图形元素会直接裁剪掉。',
},
format: [
'<XAxis type="number" domain={[0, 100]} allowDataOverflow />'
],
},
{
name: 'allowDuplicatedCategory',
Expand Down Expand Up @@ -142,6 +145,7 @@ export default {
"<XAxis type=\"number\" domain={['dataMin - 100', 'dataMax + 100']} />",
'<XAxis type="number" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />',
'<XAxis type="number" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />',
'<XAxis type="number" domain={[0, 100]} allowDataOverflow />',
],
examples: [
{
Expand Down
4 changes: 4 additions & 0 deletions src/docs/api/YAxis.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default {
"<YAxis type=\"number\" domain={['dataMin - 100', 'dataMax + 100']} />",
'<YAxis type="number" domain={[dataMin => (0 - Math.abs(dataMin)), dataMax => (dataMax * 2)]} />',
'<YAxis type="number" domain={([dataMin, dataMax]) => { const absMax = Math.max(Math.abs(dataMin), Math.abs(dataMax)); return [-absMax, absMax]; }} />',
'<YAxis type="number" domain={[0, 100]} allowDataOverflow />'
],
examples: [
{
Expand Down Expand Up @@ -190,6 +191,9 @@ export default {
'zh-CN':
'当轴是数值轴时,指定轴的定义域(domain)的时候,如果 allowDataOverflow 的值为 false,我们会根据数据的最大值和最小值来调整 domain,确保所有的数据能够展示。如果 allowDataOverflow 的值为 true,不会调整 domain ,而是将相应的图形元素会直接裁剪掉。',
},
format: [
'<YAxis type="number" domain={[0, 100]} allowDataOverflow />'
]
},
{
name: 'allowDuplicatedCategory',
Expand Down

0 comments on commit d69493f

Please sign in to comment.