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

Plot: fix pie divide by zero #428

Merged
merged 2 commits into from Oct 25, 2017

Conversation

Projects
None yet
3 participants
@jmsmyth
Copy link
Contributor

jmsmyth commented Oct 23, 2017

Description

Fixes a divide by zero issue which caused single segment pie charts not to be rendered

How Has This Been Tested?

Tested against this example:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Test</title>
    <link rel="stylesheet" type="text/css" href="https://www.hexagonjs.io/resources/hexagon/1.12.0/hexagon.css"></link>
    <link rel="stylesheet" type="text/css" href="https://www.hexagonjs.io/resources/font-awesome/css/font-awesome.min.css"></link>
    <script type="text/javascript" src="https://www.hexagonjs.io/resources/hexagon/1.12.0/hexagon.js"></script>
</head>
<body >
    <div id="graph" style="width: 400px; height: 400px"></div>

    <script>
        var pieData = {
            title: 'n/a',
            segments: [
                {name: "Seen more than 1 day(s) ago", size: 28, fillColor: "rgb(177,119,190)"}
            ]
        };
        new hx.PieChart('#graph', {
            labelsEnabled: true,
            legendEnabled: true,
            data: pieData
        });
    </script>
</body>
</html>

Screenshots (if appropriate):

Checklist:

  • I have added a tag to this pull request that indicates the impact of the change (patch, minor or major)
  • My code follows the code style of this project.
  • I have updated the documentation accordingly. (This includes updating the changelog).
  • I have read the CONTRIBUTING document.
  • All my changes are covered by tests.
  • This request is ready to review and merge

@jmsmyth jmsmyth added this to the 1.14.0 milestone Oct 23, 2017

@jmsmyth jmsmyth self-assigned this Oct 23, 2017

@jmsmyth jmsmyth requested a review from c-frater Oct 23, 2017

@coveralls

This comment has been minimized.

Copy link

coveralls commented Oct 23, 2017

Coverage Status

Coverage increased (+0.1%) to 63.703% when pulling dadaeef on fix-pie-divide-by-zero into eb5186c on master.

@c-frater c-frater merged commit 3b7d911 into master Oct 25, 2017

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.1%) to 63.703%
Details

@c-frater c-frater deleted the fix-pie-divide-by-zero branch Oct 25, 2017

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