Hi,
I am trying to use a scripted field ("RGBstring") for my visualization but it doesn't work.
I can't find the reason.
this is the script:
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data": {
"url": {
"%context%": true,
"index": "rgb-data*",
"body": {
"size": 10000,
"_source": [
"Xlocation",
"Ylocation",
"rgb.R",
"rgb.G",
"rgb.B",
"group"
],
"script_fields": {
"RGBstring": {
"script": {
"lang": "painless",
"source": "'rgb('+doc['rgb.R'].value+','+doc['rgb.G'].value+','+doc['rgb.B'].value+')'"
}
}
}
}
},
"format": {"property": "hits.hits"}
},
"mark": {"type": "square", "filled": true, "size": 1200},
"encoding": {
"x": {
"field": "_source.Xlocation",
"type": "quantitative",
"axis": {"title": "X Location"}
},
"y": {
"field": "_source.Ylocation",
"type": "quantitative",
"axis": {"title": "Y Location"}
},
"color": {"field": "fields.RGBstring", "scale": null},
"tooltip": {"field": "_source.group"}
}
}
and after running it I get:
Internal Server Error