barsPlot = new Plot(useToolTip: false);
barsPlot << new Bars(x: (1..5), y: [5, 2, 4, 3, 7], )
.onKey(KeyboardCodes.SHIFT, {info -> info.graphics.y[info.index]++})
.onKey("T", "tag1")
.onKey("K", {info -> info.graphics.y[info.index]--;
beakerx.runByTag("tag1")
})
def details = barsPlot.details
def item = details.graphics
def index = details.index
println (item.x[index] + ":" + item.y[index])
barsPlot2 = new Plot(useToolTip: false);
barsPlot2 << new Bars(x: (1..5), y: [5, 2, 4, 3, 7], )
.onClick({info -> info.graphics.y[info.index]++;
beakerx.runByTag("tag2")
})
def details2 = barsPlot2.details
def item2 = details2.graphics
def index2 = details2.index
println (item2.x[index2] + ":" + item2.y[index2])
barsPlot3 = new Plot(useToolTip: false);
barsPlot3 << new Bars(x: (1..5), y: [5, 2, 4, 3, 7], ).onClick("tag3")
def details3 = barsPlot3.details
def item3 = details3.graphics
def index3 = details3.index
println (item3.x[index3] + ":" + item3.y[index3])
barsPlot4 = new Plot(useToolTip: false);
barsPlot4 << new Bars(x: (1..5), y: [12, 6, 8, 4, 8], )