[英]Trying to set color point by column value in CartoDB
This is my first time using CartoDB. 这是我第一次使用CartoDB。 My dataset is a simulation of the behaviour of users arround the campus.
我的数据集是对校园内用户行为的模拟。 My rows have latitude, longitude and the class column depending of the cluster in which the user is.
我的行具有纬度,经度和类列,具体取决于用户所在的群集。
I saw an option to visualize the animation of the behaviour (cartodb transforms the data into a time lapse), but I'm trying to see the points colored by the class value. 我看到了一个可视化行为动画的选项(cartodb将数据转换为时间间隔),但我试图看到由类值着色的点。 In the platform, there is an option to do that, but when I choose the "animation" mode then I can't choose any of the columns to set the color.
在平台中,有一个选项可以做到这一点,但是当我选择“动画”模式时,我无法选择任何列来设置颜色。
I show you an image: 我给你看一个图像:
However, if I choose the "By points" mode, I can display the points color by the class column value. 但是,如果我选择“按点”模式,我可以按类列值显示点颜色。
Is there anyone who has had the same problem? 有没有人遇到过同样的问题? Do you have any recommendation?
你有什么建议吗?
I think the problem is on the column type, you need your column to be a string to be offered as a value, so maybe you want add a column to your SELECT statement on the DATA
tab to reclassify your clusters. 我认为问题出在列类型上,您需要将列作为一个字符串作为值提供,因此可能需要在
DATA
选项卡上的SELECT语句中添加一列来重新分类集群。 If you rename then you can also show them on the legend can reflect a better name for your clusters: 如果您重命名,那么您也可以在图例上显示它们,以反映群集的更好名称:
select *,
case cluster
when 1 then 'Cluster 1'
when 2 then 'Cluster 2'
else 'unknown'
end as cluster_named
from my_table
Something around that should help to convert cluster
numeric field into a string one, then you'll see it offered to animate by that value. 周围的东西应该有助于将
cluster
数字字段转换为字符串1,然后你会看到它提供给该值的动画。
Disclaimer : I work at CARTO 免责声明 :我在CARTO工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.