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

[Question] Line chart : label position when there is only one data #3044

Closed
madmoizo opened this issue Jul 27, 2016 · 3 comments
Closed

[Question] Line chart : label position when there is only one data #3044

madmoizo opened this issue Jul 27, 2016 · 3 comments

Comments

@madmoizo
Copy link

madmoizo commented Jul 27, 2016

Hi,

When there is only one data on a line chart, points and label are sticked on the y axe
https://jsfiddle.net/rn1pocs5/3/

Is it possible to center points + label in this case ?

I can get this result with a trick (use bar chart, add an "hidden" dataset and override type of the others) but it's a bit dirty
https://jsfiddle.net/h27rL8qq/1/

@madmoizo madmoizo changed the title [Question] Line chart one data on x axe [Question] Line chart : label position when there is only one data Jul 27, 2016
@etimberg
Copy link
Member

etimberg commented Aug 4, 2016

I think we can find a way to support this better

roicos added a commit to roicos/Chart.js that referenced this issue Aug 18, 2016
roicos added a commit to roicos/Chart.js that referenced this issue Aug 19, 2016
roicos added a commit to roicos/Chart.js that referenced this issue Aug 19, 2016
roicos added a commit to roicos/Chart.js that referenced this issue Aug 19, 2016
roicos added a commit to roicos/Chart.js that referenced this issue Aug 23, 2016
roicos added a commit to roicos/Chart.js that referenced this issue Aug 23, 2016
roicos added a commit to roicos/Chart.js that referenced this issue Aug 24, 2016
@steedlem
Copy link

steedlem commented Sep 15, 2016

I still see an issue where my axis tick label is stuck to the left but the data point is centered. This makes things look weird

@roicos
Copy link
Contributor

roicos commented Sep 15, 2016

Please, add
xAxes: [{
gridLines: {
offsetGridLines: true
}
}]
for the desired result (it controls label offset)

exwm pushed a commit to exwm/Chart.js that referenced this issue Apr 30, 2021
In line charts, when there is only one label and data point, both are now horizontally centered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants