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

LogLog plots are impossible? #4380

Closed
Nakilon opened this issue Jun 15, 2017 · 8 comments
Closed

LogLog plots are impossible? #4380

Nakilon opened this issue Jun 15, 2017 · 8 comments

Comments

@Nakilon
Copy link

Nakilon commented Jun 15, 2017

Seems like LogLog plots don't work as expected. When I add type: "logarithmic" to both axes I get this:

image

            window.chart_ads = new Chart("chart", {
              type: "bubble",
              data: data,
              options: {
                legend: { display: false },
                scales: {
                  xAxes: [ {
                    type: "logarithmic",
                    scaleLabel: {
                      display: true,
                      labelString: x,
                    }
                  } ],
                  yAxes: [ {
                    type: "logarithmic",
                    scaleLabel: {
                      display: true,
                      labelString: y,
                    }
                  } ],
                },
              }
            } );
@etimberg
Copy link
Member

@Nakilon which version are you using? There was a bug in older versions that set the default position of axes incorrectly which I believe is fixed.

Adding position: 'bottom' to the x axis options should fix it

@Nakilon
Copy link
Author

Nakilon commented Jun 16, 2017

@etimberg both adding position: 'bottom' and switching from 2.5.0 to 2.6.0 do the trick about axis, but circles anyway disappeared:

image

image

@etimberg
Copy link
Member

do you have a fiddle that reproduces this issue?

@Nakilon
Copy link
Author

Nakilon commented Jun 23, 2017

https://jsfiddle.net/q5xwqvc0/
Seems like it can't (0;0) point.

@etimberg

@Nakilon
Copy link
Author

Nakilon commented Jun 28, 2017

bump

The issue is closed but there is a bug with fiddle snippet.

@etimberg
Copy link
Member

Reopened. Looks like the problem is indeed (0,0) which isn't surprising given that it's not defined on a log axis. You could give #3958 a try and see if it improves things. I cna't promise when this might be fixed because 0 on log axes has a lot of repercussions for other parts of the code

@Nakilon
Copy link
Author

Nakilon commented Jun 29, 2017

I'm not sure I know how to try it. I'm just linking bundled version in my haml.

@etimberg
Copy link
Member

It requires cloning the branch that is the PR, rebasing it against master, and then building locally before including that file in your app. Not a straightforward process by any means

jcopperfield added a commit to jcopperfield/Chart.js that referenced this issue Nov 1, 2017
 - issue chartjs#3917: Logarithmic Scale Tick Bug for values of 0
 - issue chartjs#4380: LogLog plots are impossible (0, 0)
 - issue chartjs#2966: chart does not render if data contains value of 0 when using logarithmic scale
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

3 participants