Skip to content

Commit

Permalink
feat: add axis title align
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Jan 17, 2024
1 parent c01febb commit e957095
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vtable/examples/pivot-chart/pivotChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9406,7 +9406,7 @@ export function createTable() {
defaultRowHeight: 200,
defaultHeaderRowHeight: 30,
defaultColWidth: 280,
defaultHeaderColWidth: [80, 50],
defaultHeaderColWidth: [80, 'auto'],

corner: {
titleOnDimension: 'row',
Expand Down
5 changes: 4 additions & 1 deletion packages/vtable/src/components/axis/axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export class CartesianAxis {
gridLength = regionWidth;
axisLength = height;
}
const size = this.orient === 'top' || this.orient === 'bottom' ? height : width;
const attrs: LineAxisAttributes = {
start: { x: this.x, y: this.y },
end,
Expand All @@ -219,7 +220,9 @@ export class CartesianAxis {
text: this.option.title.text,
maxWidth: this._getTitleLimit(isX)
},
items: this.getLabelItems(axisLength)
items: this.getLabelItems(axisLength),
verticalLimitSize: size,
verticalMinSize: size
};
return attrs;
}
Expand Down

0 comments on commit e957095

Please sign in to comment.