-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ability to extend lines for thresholds and axes #2948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think you can do both of these already using Case 1: turn off {
type: 'line',
x0: 0, // or whatever the leftmost axis `position` is
x1: 1,
y0: 0, y1: 1,
xref: 'paper',
yref: 'paper'
} Case 2: {
type: 'line',
x0: 0.1, x1: 1, // or matching `xaxis.domain`
y0: 5, y1: 15, // your data value
xref: 'paper',
yref: 'y2',
line: {dash: 'dash'}
} |
Thanks. That's a helpful workaround, but not quite what I meant. Case 1: I would suggest that this is how xaxis.showline should work anyway, if there are more than 2 axes. Case 2: if I draw my threshold line as "just a line shape", then I'll lose the ability to see the tooltips, it won't appear in the Legend, and it won't get switched on and off along with the dataset by legendgroup. |
I could imagine making that an option, but not the default - A quick image search "graph many y axes" shows a whole lot of examples that all match our current behavior. Not to say that popularity makes it the correct behavior, but I've always understood the axis line to either indicate "here's the range of positions encoded by this axis," or closely related, to outline the plot area - and plotly.js toggles between these two behaviors as appropriate, but the difference is minor. Unless and until we make an option specifically for the behavior you're describing, I think a shape is still your best bet.
I see - if you want it in the legend, with tooltips, then I think you do want this to be data. For now I would suggest just moving the first data point over a bit ( Just to link these ideas together: there are some features we've talked about but haven't yet implemented that could be useful to you - allowing individual traces to specify that they don't contribute to autorange for example (which I thought had been discussed in #1876 but I don't see it) and hover on lines #1960. |
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson |
Hello. Yes, this issue is still relevant. Please re-open. |
In plotly, sometimes the lines don't go far enough, and it would be helpful to extend them.
Case 1: Multiple axes are not joined together. The x-axis line should connect all axes, not just the first 2. In the example image, I have drawn a red line where I think the x-axis should continue.
Case 2. I sometimes want to draw a target line on a chart; in this case, below the line would be "bad", resulting in a red bar, while above the line, would be good. To implement these, I have used a dedicated series, with a constant value. However, a target line should really a special case of a "grid" line, rather than a special case of a "data series", and it ought to extend right the way to the (appropriate) axis. I've drawn this in yellow on the chart below. (Even better, a target should be defined by a single value, rather than an array of repeated values).
Thanks very much :-)
The text was updated successfully, but these errors were encountered: