block by timelyportfolio 04832df8bad50a58e659707d3b8f423d

react-sparklines bar troubles

Full Screen

Built with blockbuilder.org

While playing with react-sparklines in R, I noticed that the bars would not line up perfectly. This is a quick demo of the problem that I can hopefully help resolve with a quick pull request. I would be delighted to contribute to such a great package.

index.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<script src="https://unpkg.com/react@15.3.1/dist/react.min.js"></script>
<script src="https://unpkg.com/react-dom@15.3.2/dist/react-dom.min.js"></script>
<script src="https://unpkg.com/react-sparklines"></script>

</head>
<body style="background-color:white;">
<script>
ReactDOM.render(
  React.createElement(
    ReactSparklines.Sparklines,
    {data:[175,245,180,180,180,205,215,230,150,150,245,175,264,335], svgHeight:300, svgWidth:500, min: 0, max:350, margin: 20},
    React.createElement(
      ReactSparklines.SparklinesBars,
      {style:{stroke:"lightblue",strokeWidth:2}}
    )
  ),
  document.body
)
</script>
</body>
</html>