Comments (5)
Yes, the default behaviour for 'tonexty'
seems to be to fill to the x-axis for the first dataset (although I'm new so I could be mistaken!). It you would like that fill to be "empty", you can set fill: 'none'
, and only the curve will be drawn.
'tozeroy'
will always fill between the curve and the x-axis. It becomes a challenge of presentation because the "bottom" dataset will become obscured if any "layers" on top have values greater (or less than, in the case of negative values). The reason for having the overlaid fills is so as to preserve visibility of all the data. If you would like to get rid of the overlaid colours, you can set fillcolor
using a string containing a hex code, or a rgb/rgba string such as 'rgba(241,111,203,1)'
. By setting a full opacity of 1 however, any dataset value less than a successive dataset value (at an equivalent x-value) will be hidden.
from plotly.js.
I believe that this is the expected behaviour - the data is plotted in order it is placed in the array, so in your first example, the dataset with larger y-values (Query 2) is plotted in blue, then the next dataset is plotted in orange, and the area is filled (to the next y). When using fill: 'tonexty'
you can think of the filled areas between data sets as the area between two successive curves, so their order will determine the fill areas. In your second example, you will see where orange plot dips below the x axis, the fill colour is the combined blue/orange.
from plotly.js.
I think now I get it but why blue area on the first chart is touching Y=0, only because there is no "next Y"?
BTW It seems I should use tozeroy
instead of tonexty
?
from plotly.js.
I tried tozeroy
as well and it doesn't work good - it looks quite bad. From what I understand tonexty
should work fine but only when I manually sort data series that the one with higher values is added first. Unfortunately this is not always so obvious because values can be sometimes higher and sometimes lower.
from plotly.js.
@mdtusz spot on - 'tonexty'
behaves identically to 'tozeroy'
for the first trace. This is driven by the use case of filled area charts, where you always want to fill the first trace to zero and all the others to the adjacent trace - set set all the traces to the same fill mode 'tonexty'
and this is what you get.
from plotly.js.
Related Issues (20)
- Mismatch between legend and line colors when using uppercase css colors HOT 1
- Item toggle behavior when using multiple legends HOT 8
- insiderange on multiple overlaid axes edge case
- [Feature Request] Adding a Button to Copy Image to Clipboard HOT 1
- BUG: standoff causes axis title position to break if no tick labels
- Shapes - fill to infinity/-infinity
- Adding a dendrogram to heatmaps
- Smith Chart (scattersmith) pan & zoom functionality HOT 2
- axes range not working. Range is +-1, data is 0->1.6e10 HOT 3
- ScatterGL throws ` TypeError: r[v] is undefined` when using frames HOT 1
- Clicks are sometimes missed with clickmode layout key HOT 4
- Tooltip pointer (triangle) not correctly positioned with hovermode 'x'
- Plotly chart conflict with touchstart / touchmove event to scroll smartphone screen HOT 1
- [BUG] Rangeslider won't reset after zooming out HOT 1
- Inconsistent behavior when providing an array of marker sizes in "markers" mode on scatter3D
- hoverdistance broken in 3D scatter plots; hover radius vs click radius?
- `scattergl` line plots no longer working after upgrading to 2.29.1 HOT 3
- Combining rangemode tozero and tickformat set to "," produces unexpected results
- REOPENING BUG - pie chart hover label hidden
- Hoverlabel overlaps each other
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plotly.js.