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 2 commits into from Oct 25, 2017


None yet
3 participants
Copy link

jmsmyth commented Oct 23, 2017


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>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href=""></link>
    <link rel="stylesheet" type="text/css" href=""></link>
    <script type="text/javascript" src=""></script>
<body >
    <div id="graph" style="width: 400px; height: 400px"></div>

        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

Screenshots (if appropriate):


  • 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


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
continuous-integration/travis-ci/push The Travis CI build passed
coverage/coveralls Coverage increased (+0.1%) to 63.703%

@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