-
Edit: Fix markdown failure I'm practicing on making bar chart with d3 within Vue3 framework. I have a <select> to choose between novels and the bar chart shows the distribution of paragraphs' length of that novel. When I first entering the page, the ticks are all shown. But when I select between the novels, some ticks just disappear at seemingly random pattern. Here's my code:
The Vue3 component is rather simple.
The structure of dataset is:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think I solved it. The thing is I'm too eager to make generalization about every d3 object. For objects of constant number such as axes (as opposed to bars), d3 API selection.call() would take care of everything. It still intrigues me though why certain ticks are removed when selectAll() takes one <g> tag and make one of them my new axis and remove the rest. |
Beta Was this translation helpful? Give feedback.
I think I solved it. The thing is I'm too eager to make generalization about every d3 object. For objects of constant number such as axes (as opposed to bars), d3 API selection.call() would take care of everything.
It still intrigues me though why certain ticks are removed when selectAll() takes one <g> tag and make one of them my new axis and remove the rest.