Skip to content

Commit

Permalink
Round graph X axes to zero decimal places
Browse files Browse the repository at this point in the history
This is the first step in resolving #18, as of the two current values,
this one is more useful now.
  • Loading branch information
TBBle committed Sep 3, 2018
1 parent d182fe6 commit 5ea9f52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Graph extends Component {

getOption() {
const pertResults = this.props.results['PERT'];
const pertRoundedValues = pertResults.map(x => round(x, 2));
const pertRoundedValues = pertResults.map(x => round(x, 0));
const pertPercentages = this.countHitsAsPercentage(pertRoundedValues);
const pertGrid = { top: '10%', bottom: '40%', height: '30%' };
const pertMarkLines = this.generateMarkLines(
Expand All @@ -45,7 +45,7 @@ class Graph extends Component {
);

const gaussianResults = this.props.results['Gaussian'];
const gaussianRoundedValues = gaussianResults.map(x => round(x, 2));
const gaussianRoundedValues = gaussianResults.map(x => round(x, 0));
const gaussianPercentages = this.countHitsAsPercentage(
gaussianRoundedValues
);
Expand Down Expand Up @@ -140,7 +140,7 @@ class Graph extends Component {

const result = [];
percentiles.forEach((percentileValue, index) => {
const value = round(percentile(values, percentileValue), 2);
const value = round(percentile(values, percentileValue), 0);
result.push([
{ xAxis: value, y: minY, name: percentileLabels[index] },
{ xAxis: value, y: maxY },
Expand Down

0 comments on commit 5ea9f52

Please sign in to comment.