Skip to content

Commit

Permalink
fix(scale): tickCount of log scale support -1
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini committed Apr 21, 2023
1 parent 7080def commit 6d88136
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions __tests__/plots/static/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,4 @@ export { gaugeDefault } from './gauge-default';
export { gaugeCustomColor } from './gauge-custom-color';
export { gaugeCustomShape } from './gauge-custom-shape';
export { scoreByItemAreaRadarSize } from './score-by-item-area-radar-size';
export { mockPointLogTicks } from './mock-point-log-ticks';
24 changes: 24 additions & 0 deletions __tests__/plots/static/mock-point-log-ticks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { G2Spec } from '../../../src';

export function mockPointLogTicks(): G2Spec {
return {
type: 'point',
data: [
[5, 0.09459459],
[10, 0.22972973],
[15, 0.36486486],
[20, 0.5],
[25, 0.63513514],
[30, 0.77027027],
[35, 0.90540541],
],
encode: {
x: (d) => d[0],
y: (d) => d[1],
},
scale: {
x: { type: 'log', nice: true, tickCount: -1 },
y: { type: 'log', domain: [0.001, 1], tickCount: -1 },
},
};
}
2 changes: 1 addition & 1 deletion site/docs/spec/mark/shape.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ chart.shape().style({
chart.render();
```

可以查看[图表徽章水印](/examples/annotation/annotation/#watermark)具体示例。
可以查看[图表徽章水印](/examples/annotation/shape/#watermark)具体示例。

## 选项

Expand Down

0 comments on commit 6d88136

Please sign in to comment.