Skip to content

Conversation

@roben
Copy link

@roben roben commented Feb 4, 2016

I noticed that using the label callbacks only added all returned contents to a single line in contrast to the documentation: "All functions must return either a string or an array of strings. Arrays of strings are treated as multiple lines of text.". This pull request fixes this.

@roben
Copy link
Author

roben commented Feb 4, 2016

And sorry for the merge conflict, tried to amend after pushing.

Added ticks.fixedStepSize configuration parameter to force linear scale steps.
@roben
Copy link
Author

roben commented Feb 4, 2016

I have updated the pull request which now also sports a ticks.fixedStepSize option to force fixed linear scale steps instead of automatically generated ones. In my case I had to display ranking table changes over time and there were positions skipped or even half positions displayed depending on the ranking size / max value. I also fixed a typo from the broken commit earlier.

@etimberg etimberg added the v2.x label Feb 5, 2016
@etimberg
Copy link
Member

etimberg commented Feb 5, 2016

@roben did the tabs / spacing change in the linear scale? It looks like the entire file changed :| It also looks like a really old version of the file. Can you also merge the latest v2.0-dev into your version.

It would also be great if you could add documentation for the new option to the markdown files in the docs folder.

Robert Becker added 4 commits February 5, 2016 09:28
@roben
Copy link
Author

roben commented Feb 5, 2016

It was the most recent file from v2.0-dev but I used Netbeans' auto format which had different indentation settings than your default. I have changed and reindented it, the diff is much lighter now.
I have added the configuration documentation in a new table for the linear scale section as the parameter only applies there.

I have also added the built files to the commit just for completeness.

Note that I needed to change "gulp": "3.5.x", to "gulp": "3.9.x", in package.json to prevent gulp 3.5.6 throwing an "unsupported version" error. I did not commit that change, though, as it seems to work for your environment.

@@ -0,0 +1,2 @@
auxiliary.org-netbeans-modules-javascript-karma.config=karma.conf.js
browser=Chrome.INTEGRATED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove this file and others in the nbproject directory

@etimberg
Copy link
Member

etimberg commented Feb 5, 2016

@roben thanks for updated. I added a couple of comments to the diff. Once those are addressed, I'll merge this 😄

@roben
Copy link
Author

roben commented Feb 5, 2016

The nbproject folder should't have been committed at all. I'll remove it.

Regarding the loop: Before implementing my changes I had issues with the graph ignoring suggestedMin and starting with 0.5 instead of 1 and I was confused by all the rounding going on there. I exit the loop after max has been reached to make sure that the last value has a tick label.

But what do you mean with

The reason is that for very small numbers this may fail.

? I can't see how this loop could fail besides looking really ugly if the step width is set too small.

@etimberg
Copy link
Member

etimberg commented Feb 5, 2016

The case I was thinking of is when fixedStepSize is a small number between 0 and 1. It may be that the exact number is not fully representable as a floating point number. It could be that when generating the last tick, the loop bails out one iteration early. #1498 was an earlier bug where I ended up having to change the loop that generates ticks.

@etimberg etimberg changed the title V2.0 dev Fix tooltip error and add fixed steps to linear scale Feb 6, 2016
…x conflicts.

Refactored linear scale fixed step size implementation.
Added nbproject to .gitignore
@roben
Copy link
Author

roben commented Feb 9, 2016

I have applied the changes and merged your repository to fix the conflicts.

etimberg added a commit that referenced this pull request Feb 9, 2016
Fix tooltip error and add fixed steps to linear scale
@etimberg etimberg merged commit a3dea11 into chartjs:v2.0-dev Feb 9, 2016
@etimberg
Copy link
Member

etimberg commented Feb 9, 2016

Thanks @roben

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants