TargetProcess / tauCharts

D3 based data-focused charting library. Designed with passion. Flexible.
https://www.taucharts.com
Other
1.91k stars 118 forks source link

How can one rotate the x-Axis ticks labels? #549

Open marcosvilela opened 6 years ago

marcosvilela commented 6 years ago

I'm having a huge problem with overlapping date objects on tauCharts. The solution thought of by the team that I'm in is to rotate the date label, just like tauCharts itself does when plotting a bar chart with date objects on the x-axis. But I don't get how it is done. Can anyone help with this? I suppose that, since the bar charts already does what we are trying to do, I just need to know how the bar chart rotate the labels

Mavrin commented 6 years ago

Could you show me your chart on jsfiddle? Taucharts tries automatically to avoid overlapping axis tick by default.

marcosvilela commented 6 years ago

So, I wanted to be just like this fiddle here: https://jsfiddle.net/nLdac8sc/74/

Strangely enough, It seems like the normal behaviour of tauCharts is to rotate when the values would overlap. But, for some reason, it is not doing that. Can it be something CSS-related? Since our div has a fixed height, but a % width

I'll work on doing the fiddle, but since it is a relatively big system, I don't think I'll be able to replicate the exact behaviour on a fiddle

marcosvilela commented 6 years ago

So, another information: This often happens when I use the quick-filter plugin on the data. By filtering it to a small section of the X axis, the labels start overlapping each other

Mavrin commented 6 years ago

Maybe you can attach screenshot?

marcosvilela commented 6 years ago

Here's what's happening. The dates start overlapping each other when the quick-filter is activated

sample-problem

I also noticed that it does happen on this fiddle, where the tick labels also overlap each other

Mavrin commented 6 years ago

Looks like it is bug. But you can try change fitModel settings, if it is appropriate for your case. https://jsfiddle.net/taucharts/tnhfxnuc/88/

marcosvilela commented 6 years ago

Just tried that, but it didn't work. Still it overlaps when I use quick-filter, sadly. So yeah, it looks like a bug.

Thank you for your help anyway, you were very kind. If I find a solution for this, I'll update this issue

vajura commented 5 years ago

Is there currently no way to set the rotation value yourself for labels on the X and Y axis?