Comments (2)
你好 @lin-hfy,请编辑你的 issue 标题, 一个言简意赅的 issue 标题可以节省大家的时间, 请不要将标题当做正文, 或者为空。
Hello, @lin-hfy, please edit your issue title. a concise issue title will save everyone time. please do not leave the title as the body or empty.
from s2.
自定义icon能否支持多个icon
你指的 [自定义 icon] 是行列头 (headerActionIcons) 还是字段标记 (conditions) ? 前者是支持的, 字段标记确实不支持, 会考虑在 2.0 版本中迭代 (增加多个 icon 和自定义 position 的能力), 目前的方案可以参考下文.
期望能提供单元格右上角添加tag
表格是 Canvas, 目前你可以自定义 DataCell, 然后自己在右上角绘制一个 icon 或者一个图形, 数值左右绘制多个 icon 也可以通过这种方式.
import { PivotSheet, DataCell, renderIcon } from '@antv/s2';
class CustomDataCell extends DataCell {
initCell() {
super.initCell()
this.drawIcon()
}
drawIcon() {
const { width, height, x, y } = this.meta
const size = 12
// 当前文本宽度 this.actualTextWidth, 你可以结合 meta 计算坐标自行绘制多个 icon
if(this.meta.fieldValue === 7789) {
const icon = renderIcon(this, {
x: width - size,
y: y,
// 内置或者通过 customSVGIcons 注册的 icon 名
name: 'Plus',
width: size,
height: size,
fill: 'red'
})
icon.on('click', () => {
console.log('...')
})
}
}
}
from s2.
Related Issues (20)
- 🐛S2Event.GLOBAL_CONTEXT_MENU 事件无法触发 HOT 5
- 🤔列头分组后,数据进行格式化meta,导出表格的列头非字段名,而是格式化后的数据? HOT 6
- 🐛多行头大数据(1w条左右)透视表渲染卡顿 HOT 4
- 表格内容能否转邮件? HOT 1
- 🐛导出格式化数据格式错乱 HOT 5
- data cell合并之后能自定义渲染吗? HOT 1
- 🐛 明细表,排序问题,排序在空值处断开 HOT 3
- 透视表渲染10w+的单元格内存持续飙升(可能内存泄漏)浏览器崩溃 HOT 2
- 透视表能不能支持后端计算,前端直接渲染就行了呀,前端百万级性能瓶颈比较明显
- 更新到2.x版本,明细表自定义排序,菜单点击无效果 HOT 3
- 🤔 官网示例 sandbox 打开报错 HOT 2
- 🐛复制/下载数据超过1w条时出现重复数据 HOT 1
- 🐛滚动边界问题:表格和父容器的滚动条会同时滚动 HOT 1
- 🙏S2表格values能否增加可以设置的下划线标识,以便于客户识别下钻? HOT 1
- 🤔导出功能中能否不对日期进行格式化 HOT 1
- 透视表:布局方式使用 layoutWidthType: 'colAdaptive' 宽度足够的情况下表头有省略号出现?🤔 HOT 6
- 🙏自定义列头分组后导出功能可以支持合并单元格吗?
- 🐛SheetComponent 里面设置的 cell 高度没有生效 HOT 1
- 🐛 明细表/透视表 使用 drawTextShape 在值单元格绘制图片,滚动时图片会重新加载,且在 行/列 单元格使用 drawTextShape 绘制图片,鼠标移动到图片上控制台会报错。 HOT 1
- 🙏透视表 没数据显示一行空数据,希望支持加入图标么比如像antd table 的暂无数据 HOT 3
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 s2.