question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make X axis labels rotation angle more customizable

See original GitHub issue

Hey guys,

We are enjoying using ngx-charts and we’d like to contribute a couple of things that would make charts more configurable.

I’m submitting a … (check one with “x”)

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here

Current behavior The labels of the x axis are rotated automatically, and cannot be adjusted.

Expected behavior We would like to define the rotation angle only if it is necessary. For this reason, we would expect the possibility to use the rotation by default, but have the option of disabling it if needed based on input to the XAxisTickComponent.

Reproduction of the problem If the width of the chart changes, the rotation angle of the labels change as well.

What is the motivation / use case for changing the behavior? The motivation for this feature is to be able to customize the style of the axis in a lower level.

  • ngx-charts version: x.x.x 6.1.0

  • Angular version: 2.x.x 4.3.1

  • Browser: Chrome XX

  • Language: TypeScript 2.3.4

If possible, we would gladly make a PR to your project to enable this feature.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:6
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
marjan-georgievcommented, Oct 16, 2017

Sounds good, let’s do it!

Are you using the axis components in a custom chart? Or do you plan to add this change to all charts that have axes?

0reactions
michaelbanckcommented, Oct 27, 2022

Maybe I am overlooking something, but isn’t that quite easy to achieve with CSS? So as a workaround something like that:

::ng-deep .tick text { transform: rotate(-40deg); }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adjusting the Angle of Axis Labels - Excel Ribbon Tips
Right-click the axis labels whose angle you want to adjust. · Click the Format Axis option. · Using the Custom Angle control, adjust...
Read more >
How to Rotate Axis Labels in Excel (With Example) - Statology
In the Format Axis panel that appears, click the icon called Size & Properties and type -45 in the box titled Custom angle:....
Read more >
GGPlot Axis Ticks: Set and Rotate Text Labels - Datanovia
Change the style and the orientation angle of axis tick labels. For a vertical rotation of x axis labels use angle = 90...
Read more >
Rotating and spacing axis labels in ggplot2 - Stack Overflow
Change the last line to q + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1)). By default, the axes are aligned at...
Read more >
How to rotate axis labels in chart in Excel? - ExtendOffice
Right click x-axis --> format axis --> text options --> click the third image tab --> text box --> keep as horizontal and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found