bokehJS linked on x_range
HTML
<script src="https://cdn.pydata.org/bokeh/release/bokeh-1.3.4.min.js"></script>
<script src="https://cdn.pydata.org/bokeh/release/bokeh-api-1.3.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<div id="plot1"></div>
<div id="plot2"></div>
JavaScript
//==========================================
x0 = ["2001-01-01T00:00:00Z", "2001-02-01T00:00:00Z", "2001-03-01T00:00:00Z", "2001-04-01T00:00:00Z", "2001-05-01T00:00:00Z"];
x1 = [];
x0.forEach(function(entry) {
x1.push(Date.parse(entry))
});
y1 = [];
y2 = [];
for (i = 0; i < 6; i++) {
y1.push(Math.random() * 10);
y2.push(Math.random() * 10);
}
//==========================================
var plt = Bokeh.Plotting;
var tools = "pan,crosshair,wheel_zoom,box_zoom,reset,save";
//==========================================
var xdr = new Bokeh.DataRange1d({bounds: "none"});
//==========================================
var p1 = new plt.figure({
width: 200,
height: 200,
tools: tools,
x_axis_type: "datetime",
x_range: xdr
});
var line = p1.line(x1, y1, {
line_width: 2,
line_color: "#0000FF"
});
p1.title = "Plot1";
//==========================================
var p2 = new plt.figure({
width: 200,
height: 200,
tools: tools,
x_axis_type: "datetime",
x_range: xdr
});
var line = p2.line(x1, y2, {
line_width: 2,
line_color: "#FF0000"
});
p2.title = "Plot2";
plt.show([p1, p2]);