New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何实现自定义坐标label为不同的颜色 #3401
Comments
使用回调的方式来设置 label.style 属性。 chart.axis('x-field', {
label: {
style: (item: any, index: number, items: any[]) => ShapeAttrs;
}
}) |
“ShapeAttrs”是什么意思?这个code直接copy不可行。ShapeAttrs代表什么?能举个例子吗?比如是不是
这个例子我试过了,也行不通。 还有,如果要把connectorStroke也换成跟各自的Mark相同的颜色(这个例子里按照"name"分配颜色),可能吗?我在各个documentation里怎么找都没找到。。。 |
ShapeAttrs 是指原生的 canvas/svg 属性配置,参考 https://g.antv.antgroup.com/api/css/inheritance 这个文档最下面的表格。 (item: any, index: number, items: any[]) => ({ fill: 'red' }); |
我还是不明白。 而且,我在label里尝试了下,
添加 |
请问你找到label对应mark的方法了吗? |
没有!你要是找到了,告诉我一声 |
使用的啥版本? |
What problem does this feature solve?
同一个图表的同一个坐标轴,但是他们label可以有不同的颜色
如下图所示:
What does the proposed API look like?
no
The text was updated successfully, but these errors were encountered: