Comments (6)
Also, the documentation for the legend.disabled property states:
Controls if element is disabled.
A disabled element is hidden, and is removed from any processing, layout calculations, and generally treated like if it does not existed.
The element itself is not destroyed, though. Setting this back to false, will "resurrect" the element.
I read this as that setting disabled=true
should be like setting the CSS display:none
on an HTML element, in that the element should be treated as it does not exist.
However, I'm not finding this behavior is true. None of the items that I've tried setting disabled=true
to that inherit from a Sprite actually cause the canvas to re-layout the element. It's acting more like CSS visibility: hidden
and visibility: visible
.
from amcharts4.
Solved in 4.0.0-beta.28 (changelog).
from amcharts4.
Should hiding and showing a legend cause the chart to reposition to occupy the space the legend was using?
If so, it's not working properly.
It does work if I use chart.legend.disabled
to toggle the legend, but using show()
or hide()
just toggle visibility without the chart reclaiming the space.
from amcharts4.
Hm, that's a functional question. Should toggling item visibility also remove it from the layout tree? I tend to think it should not. Sort of like visibility: hidden
equivalent.
While, disabled = true
is display: none
.
from amcharts4.
For me, I would expect show()
and hide()
to work like display: none
, but that might just be because that's the behavior of the common JS frameworks (e.g. jQuery). That doesn't mean I'm right, it was just my expectation. Usually showing or hiding an object removes it from the layout.
I certainly would expect setVisibility()
to just be the equivalent of the CSS visibility
property.
I would recommend that the documentation makes it very clear that the show()
and hide()
methods don't effect layout and point the user to using disabled
if they require it be removed from layout.
Anyway, based on expectation, things seem to be working correctly now.
from amcharts4.
Gotcha. Makes sense.
However, in SVG CSS works a lot differently than in HTML. And we - being SVG charts - are operating under SVG defaults.
In any case, we will discuss if this one more time.
Thanks!
from amcharts4.
Related Issues (20)
- Accessibility Issue: aria-command-name HOT 2
- Not able to print whole chart HOT 2
- How to change legend when use slice grouper by zoom click behavior HOT 3
- Remove Fill color from Pictorial Stacked Chart HOT 4
- In a FunnelSeries chart, how can I show labels in the sliceLinks? HOT 2
- How to hide the tooltip shown for xAxis title HOT 2
- How to hide the bullets when zoom in or zoomout event called HOT 2
- How bar chart with parent and sub catagory HOT 15
- Amchart 4 Legend In Arabic are not Showing Properly HOT 2
- Unable set label for radar chart as per my requirements HOT 2
- How to ensure consistent PNG export appearance regardless of browser zoom? HOT 5
- Amchart4 is ignoring null-category in data HOT 3
- minZoomCount for categoryAxis on yAxis HOT 2
- Pie of a Pie (problems with the lines) HOT 2
- How to show text in chart area without overlapping with the bars ? HOT 2
- Local formatter for ValueAxis HOT 2
- [Question] Multiple CandlestickSeries is shifted relative to each other HOT 2
- Wrong cursor position when viewbox and real width/height not matching HOT 3
- Map with clustered points and lines HOT 2
- Center wrapped legend items HOT 2
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 amcharts4.