Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapping Functionality for X and Y Axis Labels #143

Open
mrinasugosh opened this issue Aug 5, 2019 · 0 comments
Open

Wrapping Functionality for X and Y Axis Labels #143

mrinasugosh opened this issue Aug 5, 2019 · 0 comments

Comments

@mrinasugosh
Copy link
Contributor

mrinasugosh commented Aug 5, 2019

Detailed description

This is a feature request for wrapping functionality on Carbon Labels in the X and Y axis of the line graph.

This issue is related to the Line Graph Component.

When adjusting the css on the svg text (max width) expected the label to wrap after a certain width. Instead the label didn't

Version: Carbons-Addons-Data-Viz-React 1.22.0

Team: IBM Cloud Lab's UIM Team

Steps to reproduce the issue

  1. Create a Line Graph
  2. Adjust the CSS to rotate the label's on x-axis to be horizontal
  3. Adjust the CSS to set max width (label doesn't wrap)

Details:

Based on User Feedback, we decided to have horizontal labels on the x-axis instead of the default diagonal labels. As shown in the graph below, with some css edits we can rotate the text to appear horizontally. The issue is when we try to wrap the date and time label in two separate lines.
image

Things we have tried:

  1. CSS max-width (!important)

    • max-width didn't work because Line Graph Charts are built on top of the D3 Charts. D3 has an override that needs a separate wrap function. The general norm has been to use the following implementation: https://bl.ocks.org/mbostock/7555321
  2. New Line character as part of the string passed in

Labels

enhancement
help wanted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant