通过rawgraph/d3中的列来指定颜色 [英] Dictate colors via column in rawgraph/d3
问题描述
创建原始图形时( http://rawgraphs.io ),有什么方法可以在其中创建列我的文档规定了代表条形/气泡的颜色,还是我选择代表数据?
When creating a rawgraph (http://rawgraphs.io) is there any way I can have a column in my document that dictates the colors of the representing bar/bubble or however I chose to represent my data?
示例文档可能如下
Gender - Age - Color
Male - 23 - blue
female - 17 - red
因此生成的图形上的颜色由颜色列指定
So the color on the generated graph gets dicated by the color column
推荐答案
颜色是由RAWGraphs使用从现有调色板中选取的有序刻度(来自d3.js)生成的,因此无法从中指定颜色数据表.
Colours are generated by RAWGraphs using an ordinal scale (from d3.js) picking from a pre-existing palette, so there is no way for dictating the colours from a data table.
无论如何,您可以将颜色映射到特定值,导出SVG并随后在矢量图形编辑器(Adobe Illustrator允许您通过填充/描边颜色选择对象)中对其进行更改,或者更棘手的是,使用文本编辑器执行查找并替换所有十六进制值.
Anyway, you could map the colours on specific values, export an SVG and change them afterwards within a vector graphics editor (Adobe Illustrator lets you select object by fill/stroke colour) or, more tricky, with a text editor performing a find-and-replace for all the hexadecimal values.
如果您认为颜色指示是有用的功能,请尝试在GitHub上发布问题.
If you think the colour dictation is a useful feature, try to open a issue on GitHub.
这篇关于通过rawgraph/d3中的列来指定颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!