diff --git a/app/javascript/components/tpi/AscorRecentEmissions.js b/app/javascript/components/tpi/AscorRecentEmissions.js index bf608bbc1..036800076 100644 --- a/app/javascript/components/tpi/AscorRecentEmissions.js +++ b/app/javascript/components/tpi/AscorRecentEmissions.js @@ -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, diff --git a/app/javascript/components/tpi/charts/ascor-benchmarks/Chart.js b/app/javascript/components/tpi/charts/ascor-benchmarks/Chart.js index 7cb0c4bc3..287fddf34 100644 --- a/app/javascript/components/tpi/charts/ascor-benchmarks/Chart.js +++ b/app/javascript/components/tpi/charts/ascor-benchmarks/Chart.js @@ -54,6 +54,7 @@ const Chart = ({ data: { data, metadata } }) => { ...options, yAxis: { ...options.yAxis, + min: 0, title: { ...options.yAxis.title, text: metadata.unit } }, series: chartData diff --git a/app/services/api/ascor/benchmarks_chart.rb b/app/services/api/ascor/benchmarks_chart.rb index 972eaa456..2d63c59c0 100644 --- a/app/services/api/ascor/benchmarks_chart.rb +++ b/app/services/api/ascor/benchmarks_chart.rb @@ -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