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

Use 20 sections for scale instead of 24 #179

Open
skolarianer opened this issue Sep 18, 2016 · 0 comments
Open

Use 20 sections for scale instead of 24 #179

skolarianer opened this issue Sep 18, 2016 · 0 comments

Comments

@skolarianer
Copy link

I suggest to divide the scale in 20 sections instead of 24. Percentage is using the decimal system and not the duodecimal system. Therefore it is a bit confusing when for example the 10% track ends between two bars. Using 20 sections leads to bars in 5% steps which is IMHO more reasonable.

        /**
         * Draw the scale of the chart
         */
        var drawScale = function() {
                var offset;
                var length;

                ctx.lineWidth = 1;
                ctx.fillStyle = options.scaleColor;

                ctx.save();
                for (var i = 20; i > 0; --i) {
                        if (i % 5 === 0) {
                                length = options.scaleLength;
                                offset = 0;
                        } else {
                                length = options.scaleLength * 0.6;
                                offset = options.scaleLength - length;
                        }
                        ctx.fillRect(-options.size/2 + offset, 0, length, 1);
                        ctx.rotate(Math.PI / 10);
                }
                ctx.restore();
        };
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