Skip to content

Commit

Permalink
refactoring: ASCOR benchmark chart Y axis always starts at 0
Browse files Browse the repository at this point in the history
  • Loading branch information
martintomas committed Dec 6, 2023
1 parent 55cdf50 commit c805bcf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/javascript/components/tpi/AscorRecentEmissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ AscorRecentEmissions.propTypes = {
default_trend_filter: PropTypes.string.isRequired,
data: PropTypes.arrayOf(
PropTypes.shape({
value: PropTypes.number,
value: PropTypes.string,
source: PropTypes.string,
year: PropTypes.number,
unit: PropTypes.string.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const Chart = ({ data: { data, metadata } }) => {
...options,
yAxis: {
...options.yAxis,
min: 0,
title: { ...options.yAxis.title, text: metadata.unit }
},
series: chartData
Expand Down
2 changes: 1 addition & 1 deletion app/services/api/ascor/benchmarks_chart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def pathway
end

def benchmarks
@benchmarks ||= ::ASCOR::Benchmark.where(country_id: country_id)
@benchmarks ||= ::ASCOR::Benchmark.where(country_id: country_id).sort_by(&:benchmark_type).reverse
end
end
end
Expand Down

0 comments on commit c805bcf

Please sign in to comment.