-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Hi,
My data looks like this:
[
{'commit': 'a', 'timestamp': 1234, 'benchmark': 'b', 'value': 1}
...
]
I am trying to plot ordinal values on the x axis using a temporal scale (timestamps). This
vl.markLine()
.encode(
vl.x()
.fieldT('timestamp')
.title("Commit")
.axis({
labelAngle: 90,
}),
vl.y().fieldQ('value').scale({ zero: false }).title("Run time (s)"),
vl.color().fieldN('benchmark').title("Benchmark"),
vl.tooltip().fieldN('commit')
)
puts each point in its proper place. However the axis labels are the timestamps themselves. I would like to print the commit field instead, placed at the proper timestamp (thus possibly irregularly spaced). I have tried a few things such as defining a new scale for the axis and proving a list of values, or registering a new vega.expressionFunction and calling it from a labelExpr, without success. The labelExpr is passed objects with scaled values. The information loss prevents me from easily retrieving the proper label.
I am sure this can be done in vega/vega-lite as this sounds relatively trivial. However I could not figure it out by reading the docs or the examples.
Thanks!