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

Display "comparing budget" on right/bottom #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion _src/js/compare/DiffTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export default class DiffTable extends React.Component {
]
};

// display the compared budget on the bottom
data.datasets.reverse();

return <tr key={entry.key}>
<td>
<h4>
Expand Down Expand Up @@ -112,4 +115,4 @@ export default class DiffTable extends React.Component {
</tbody>
</table>
}
}
}
8 changes: 5 additions & 3 deletions _src/js/compare/Total.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ export default class Total extends React.Component {
}),
};

// display the compared budget on the bottom
data.datasets.reverse();

return <div>
<h2>Total Change:
<DiffStyled diff={diff} colors={this.props.diffColors} usePct={this.props.usePct}>
</DiffStyled>
<DiffStyled diff={diff} colors={this.props.diffColors} usePct={this.props.usePct} />
</h2>
<HorizontalBar data={data} height={25} options={compareChartOptions}></HorizontalBar>
</div>
}
}
}
5 changes: 4 additions & 1 deletion _src/js/compare/Trend.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ export default class Trend extends React.Component {
});
const data = {labels, datasets};

// display the compared budget on the right
data.datasets.reverse();

return <Bar data={data} options={chartOpts} height={125}></Bar>

}
}
}
2 changes: 1 addition & 1 deletion _src/js/compare/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,4 @@ class Compare extends React.Component {
ReactDOM.render(
<Compare/>,
document.getElementById('root')
);
);