Skip to content

How to display scale as time unit integers? #9525

Closed Answered by clickworkorange
clickworkorange asked this question in Q&A
Discussion options

You must be logged in to vote

I found a solution, by surrendering to the time lords and passing a UTC time as the value for the x axis (as time passed from 2012/01/01) and formatting the x axis thusly:

    x: {
    	field: "time", 
    	type: "temporal",
    	timeUnit: "hoursminutes",
    	title: "Hours from start",
    	axis: {
    		tickCount: "hours",
    		labelExpr: "[timeFormat(datum.value, '%H')]"
    	}
    }).

The key was finding labelExpr and timeFormat in the axis documentation - and... tada!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by clickworkorange
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant