I’ve got a figure where the axis value is changed via a Select and it’s all working nicely except I don’t know how to code the JS to tell it to change between axes types and formatting types.
Changing axis types and setting the formatters is easy in Python (only now I’ve figured it out lol):
x_axis_type="datetime"within p.figure(), and
p.xaxis.formatter = DatetimeTickFormatter(minutes= "%M"), stated after p.figure().
don’t need to state axis type as linear is already default. And for the formatter:
p.xaxis.formatter = NumeralTickFormatter(format="0,0").
But now I want to control these conditions in JS.
x_axis.formatter.format = "0,0" worked well for changing the format in JS, although it doesn’t specify it needs to be a NumeralTickFormatter. I also thought
x_axis.type = "datetime" might work to change the axis type in JS, but it seems it didn’t.
So in short:
- what’s the JS code to set datetime / default axis types?
- what’s the JS code to set the axes formatter type and the formatter value?
x_axis.formatter.format = "0,0"worked fine in JS before changing axis types but I notice it doesn’t specify the formatter type. Perhaps the formatter type was already taken from
p.xaxis.formatter = NumeralTickFormatter(format="0,0")in Python?
On a sidenote, is there anywhere we can find the JS equivalent code for things explained in the documentation?