Comments (4)
对于折线图,label 的 position 参考位置是折线上的每个点,所以 position 无论设置什么,都是一个点。你需要设置的是 label 相对于这个点,怎么显示?是左对齐,还是右对齐,或者上下对齐方式,可以使用下面的方法:
chart.line().label({
text: 'value',
position:'left',
textAlign: 'right',
textBaseline: 'top',
});
from g2.
@hustcc
我这个配置 label 相对于这个点右对齐,图看着也不对啊
from g2.
- textAign = right 意思是标签文本的右边对着那个数据点的 x
- textBaseline = bottom 意思是标签文本的底部对着那个数据点 y
from g2.
@hustcc 明白了,谢谢
from g2.
Related Issues (20)
- label偶尔显示不全 HOT 2
- 直角坐标系坐标轴数据都是0的情况下,如何设置轴线在最底部? HOT 1
- 折线图悬停提示不正确 HOT 3
- 堆叠图缺失数据,切换图例,导致柱状图显示错误 HOT 1
- 官方示例中toolTip为false为什么还会有悬浮框显示 HOT 1
- 多个漏斗图同时渲染时,其中1个或者两个都会,渲染之后又消失掉 HOT 2
- 折线图设置滚动条后,为0值的point样式在滚动之后,会被坐标轴的线给挡住 HOT 1
- 柱折组合图。.scale('series', { independent: true })表示含义是什么
- 【G2 多轴图】多数据的柱形折线混合图,拖动滚动条,tooltip框内容显示错误 (BUG情况与6335相同,但是还有两个小BUG一并列出)
- 雷达图,维度和颜色 拖入同一个字段,tooltip 内展示的颜色不正确
- 饼图怎么支持排序 HOT 1
- 如何能调节shape的层级 使其不遮挡pieLabel
- 图形宽度设置百分比 HOT 1
- 散点图label 设置 position:inside 后 ,如何实现 内容 超出省略的功能
- 分组条形图提示错误 HOT 1
- chrome 85版本 配置了polyfill之后饼图的tooltip依旧报错 HOT 19
- 【g2】 【v5.2.1】报错,图表无法显示;报错内容:ReferenceError: group is not defined HOT 4
- 【V5】legend itemMarker 的内置类型是否可以扩展? HOT 3
- 柱线混合图,坐标轴刻度不对齐,有什么方法可以对齐 HOT 5
- 新版本g2 5.2.1 没有保存图片的方法了, chart.downloadImage()不能使用显示不存在这个方法 HOT 1
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.