Closed allenye66 closed 2 years ago
rangebreaks
should be an array of objects, not just an object. Does this fix it?
@alexcjohnson I have updated my code, but it still does not seem to work.
xaxis:
[
{
color: 'red',
rangebreaks: {
bounds: ["sat", "mon"],
values: ["2019-12-25"],
bounds: [17, 9], pattern: "hour"
}
}
],
Try this:
xaxis: {
color: 'red',
rangebreaks: [{
bounds: ["sat", "mon"],
values: ["2015-12-25"],
bounds: [17, 9], pattern: "hour"
}]
}
@alexcjohnson Thank you! That seemed to limit the hours from 5 pm to 9 am. However, the bounds ["sat", "mon"]
still don't seem to get rid of weekends, which according to https://plotly.com/python/time-series/ should. Do you know how to fix that?
Ah sorry, I missed that in your code - this is why rangebreaks
is a list, because each pattern you want to exclude needs to be a separate object:
xaxis: {
color: 'red',
rangebreaks: [
{bounds: ["sat", "mon"]},
{values: ["2015-12-25"]},
{bounds: [17, 9], pattern: "hour"}
}]
}
@alexcjohnson Thank you so much! It is working now.
My range break doesn't seem to work. I am following the documentation here: https://plotly.com/javascript/reference/#layout.