Vega-lite: Selecting values upon start in a barchart

Created on 23 Feb 2018  路  2Comments  路  Source: vega/vega-lite

Hi,

I would like to pre-select certain values in a barchart up loading.

How would I do that?

For Example:

Selecting in advance Feb 2018 in this graph

image

Current spec:

var vlSpec =
{
"$schema": "https://vega.github.io/schema/vega-lite/v2.json",
"data": { "url": "php/solar.php" },
"vconcat": [{
"width": 1000,
"mark": "area",
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"scale": { "domain": { "selection": "brush" } },
"axis": { "title": "" }
},
"y": { "field": "price", "type": "quantitative" }
}
}, {
"width": 1000,
"height": 50,
"mark": "area",
"selection": {
"brush": { "type": "interval", "encodings": ["x"] }
},
"encoding": {
"x": {
"field": "date",
"type": "temporal",
"axis": { "format": "%Y-%m" }
},
"y": {
"field": "price",
"type": "quantitative",
"axis": { "tickCount": 3, "grid": false }
}
}
}]
}

Most helpful comment

+1 on this feature request. I really need just the feature described as my main chart is very busy (15 - 20 lines) and not really useful until you zoom in on a section. I'd love to be able to have the overview selection default to an initial domain.

All 2 comments

I will be great to extend values of "empty" with something like filter transform and kind of aggregate to allow select first, last or median values.
I think it will be very helpful improvement for dependent charts. By the way I found another mention of this problem on forum https://groups.google.com/forum/#!topic/vega-js/ctj8jFP-aaA

+1 on this feature request. I really need just the feature described as my main chart is very busy (15 - 20 lines) and not really useful until you zoom in on a section. I'd love to be able to have the overview selection default to an initial domain.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mcadams92 picture mcadams92  路  3Comments

ijlyttle picture ijlyttle  路  4Comments

swanderz picture swanderz  路  4Comments

mcnuttandrew picture mcnuttandrew  路  3Comments

infai-feineis picture infai-feineis  路  3Comments