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

Title cannot be centered in a column chart #53

Closed
j27cai opened this issue Jul 12, 2016 · 3 comments
Closed

Title cannot be centered in a column chart #53

j27cai opened this issue Jul 12, 2016 · 3 comments

Comments

@j27cai
Copy link

j27cai commented Jul 12, 2016

Basically the labels influence where the title is positioned, and there is no way to center the title based on the entire chart area including the labels.

@martynasma
Copy link
Collaborator

Correct. The title is centered over plot area, not chart area. We found the other way to look very awkward.

As a workaround, I propose to use regular labels to add chart-area-centered text. Use allLabels for that.

You may also need to use marginTop in order to give the label/title some space.

  "allLabels": [{
    "text": "This is chart-area-centered label",
    "align": "center",
    "bold": true,
    "size": 20,
    "y": 10
  }],
  "marginTop": 50,

Here's a live chart:

http://codepen.io/team/amcharts/pen/fc97a2d3aa61508cc23d7aef554cde82

I hope this helps.

@icangku
Copy link

icangku commented Aug 28, 2018

how to have dynamic text in allLabels ?

@martynasma
Copy link
Collaborator

Something like this:

chart.allLabels[0].text = "new text";
chart.validateNow();

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

3 participants