Comments (1)
这个配置在指定了 paddingBottom 才会生效:
import { Chart } from '@antv/g2';
const data = [
{ year: '1991/04/10', value: 3 },
{ year: '1992/04/10', value: 4 },
{ year: '1993/04/10', value: 3.5 },
{ year: '1994/04/10', value: 5 },
{ year: '1995/04/10', value: 4.9 },
{ year: '1996/04/10', value: 6 },
{ year: '1997/04/10', value: 7 },
{ year: '1998/04/10', value: 9 },
{ year: '1999/04/10', value: 13 },
];
const chart = new Chart({
container: 'container',
autoFit: true,
paddingBottom: 40, // 这里
});
chart
.data(data)
.encode('x', 'year')
.encode('y', 'value')
.axis('x', {
labelAutoRotate: {
type: 'rotate',
/** 可选的旋转角度值 */
optionalAngles: [0, 20, 45, 90],
},
})
.scale('x', {
range: [0, 1],
})
.scale('y', {
domainMin: 0,
nice: true,
});
chart.line().label({
text: 'value',
style: {
dx: -10,
dy: -12,
},
});
chart.point().style('fill', 'white').tooltip(false);
chart.render();
from g2.
Related Issues (20)
- 5.0如何实现数据差距过大的折线效果
- Disable animation not working
- 很多图例的情况下,切到第二页图例时,图表宽度缩放会导致图例看不见
- 能添加默认背景色吗 HOT 1
- elementHighlight在折线图中设置无效
- scale time mask参数能否支持自定义函数
- Uncaught (in promise) TypeError: Cannot destructure property '__data__' of 'element.parentNode' as it is null
- stack 时间格式 resize后 tooltip hover部分轴不显示
- tooltip render函数items只能拿到color name value
- Error: require() of ES Module HOT 1
- Tutorial example has bug: if a data point is removed, the tooltip color is off -- 缺少data point导致 tooltip颜色和折线颜色不符
- axis的labelFill颜色不是我给的颜色,请问我要如何调整 HOT 1
- 柱状图x轴下方和y轴左侧对应字段的文字如何去除
- 为什么我的图表没有刻度显示
- plot:click 点击图例也会触发
- 折线图图例快速点击2次线会消失
- 堆叠柱形图在使用 Slider 时,更新数据会导致柱形图渲染比例错误
- 饼图 标签在设置了fontSize后并没有根据字体大小进行自适应隐藏 HOT 1
- 旭日图左上角的面包屑导航样式是否可以设置
- itemMarker我看是个DisplayObject,那么它有哪些属性 选项呢?并且我想让hyphen变粗一点 要怎么调
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from g2.