Skip to content

Commit

Permalink
feat(axis): provide splitLine.showMinLine and splitLine.showMaxLine
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetzhDing committed Apr 29, 2022
1 parent 3961cef commit e722624
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/component/axis/CartesianAxisView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ const axisElementBuilders: Record<typeof selfBuilderAttrs[number], AxisElementBu
tickModel: splitLineModel
});

if (!splitLineModel.get('showMinLine')) {
ticksCoords.shift();
}
if (!splitLineModel.get('showMaxLine')) {
ticksCoords.pop();
}

const p1 = [];
const p2 = [];

Expand Down
4 changes: 4 additions & 0 deletions src/coord/axisCommonTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ interface MinorTickOption {

interface SplitLineOption {
show?: boolean,
// true | false | null/undefined (true)
showMinLine?: boolean,
// true | false | null/undefined (true)
showMaxLine?: boolean,
interval?: 'auto' | number | ((index:number, value: string) => boolean)
// colors will display in turn
lineStyle?: LineStyleOption<ZRColor | ZRColor[]>
Expand Down
9 changes: 7 additions & 2 deletions test/axis-interval.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e722624

Please sign in to comment.