Webcharts
Webcharts copied to clipboard
Allow a single control input to change multiple config properties.
Something like this? { type: "dropdown", options: ["x.column","marks[0].per[0]"], label: "Group by", values: ["Sector", "PrimaryFunction", "year", "Title"], require: true },
Right now you have to do something gross like this:
myChart.on("layout",function(){
var chart=this;
this.controls.wrap
.select(".control-group").select("select")
.on("change",function(){
var value = d3.select(this).property("value");
chart.config.marks[0].per[0]=value
chart.config.x.column=value
chart.draw()
})
})
this is actually already implemented (but undocumented) for control.type: 'dropdown'
; should be easy to allow other control types to do the same.
Update the wiki and implement this for all other control types except for subsetter.