Google Charts -- radar -- image in area?

161 views
Skip to first unread message

John Freebury

unread,
Dec 12, 2020, 9:03:17 PM12/12/20
to Google Visualization API
Hi All ,
I am creating a radar chart and need it to have an image in the area of the chart, replacing a solid fill. 
Looking at the Radar chart script here -- https://developers.google.com/chart/interactive/docs/gallery/vegachart#radar-chart-example -- I wonder whether it is possible. Can the "marks" properties be adjusted to insert an image, perhaps working with the transparency?   Attached is a sample. 

Here's a snippet from that script: 
...
"marks": [
              {
                "type": "group",
                "name": "categories",
                "zindex": 1,
                "from": {
                  "facet": {"data": "table", "name": "facet", "groupby": ["category"]}
                },
                "marks": [
                  {
                    "type": "line",
                    "name": "category-line",
                    "from": {"data": "facet"},
                    "encode": {
                      "enter": {
                        "interpolate": {"value": "linear-closed"},
                        "x": {"signal": "scale('radial', datum.value) * cos(scale('angular', datum.key))"},
                        "y": {"signal": "scale('radial', datum.value) * sin(scale('angular', datum.key))"},
                        "stroke": {"value": color},
                        "strokeWidth": {"value": 1.5},
                        "fill": {"value": color},
                        "fillOpacity": {"value": 0.1}

                      }

...

Any help would be most welcome.  Thanks! 
RadarGraph - web - image-fill-area.jpg

Daniel LaLiberte

unread,
Dec 12, 2020, 10:14:25 PM12/12/20
to Google Visualization API
Hi John,

There is a potential solution involving use of blends to implement masking.  See the issue that started it:

The change that added blends: 

The mark documentation - look for the blend color property.

How css blend modes might be used to implement masking of an image.

Also, how to draw an image in Vega:
...

There is still a lot to figure out to put all this together, but it seems possible.


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/0f5df060-a38f-41a9-bb2f-1f3bc726507fn%40googlegroups.com.


--

John Freebury

unread,
Dec 13, 2020, 2:02:58 AM12/13/20
to Google Visualization API
That does look like an interesting challenge indeed.  I'll post my progress here. 
Much Thanks! 

Reply all
Reply to author
Forward
0 new messages