File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed
src/views/CountryRiskWatch/RiskBarChart/WildfireChart Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change 44 "average" : " Average (2003 - {currentYear})" ,
55 "year" : " Year {currentYear}" ,
66 "minMax" : " Min-max (2003 - {currentYear})" ,
7- "minMaxValue" : " {min} - {max}"
7+ "minMaxValue" : " {min} - {max}" ,
8+ "monthlySeverityRating" : " Monthly Severity Rating"
89 }
910}
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ type GetCountryRisk = paths['/api/v1/country-seasonal/']['get'];
3939type CountryRiskResponse = GetCountryRisk [ 'responses' ] [ '200' ] [ 'content' ] [ 'application/json' ] ;
4040type RiskData = CountryRiskResponse [ number ] ;
4141
42- const X_AXIS_HEIGHT = 24 ;
43- const Y_AXIS_WIDTH = 32 ;
42+ const X_AXIS_HEIGHT = 32 ;
43+ const Y_AXIS_WIDTH = 48 ;
4444const CHART_OFFSET = 0 ;
4545
4646const chartMargin = {
@@ -220,6 +220,16 @@ function WildfireChart(props: Props) {
220220 ref = { chartContainerRef }
221221 >
222222 < svg className = { styles . svg } >
223+ { /* FIXME: Use a separate component for chart label */ }
224+ < text
225+ className = { styles . yAxisLabel }
226+ textAnchor = "middle"
227+ transform = { `translate(${ ( chartMargin . left - CHART_OFFSET ) / 3 } ,
228+ ${ ( chartBounds . height - chartMargin . bottom - chartMargin . top ) / 2 } )
229+ rotate(-90)` }
230+ >
231+ { strings . monthlySeverityRating }
232+ </ text >
223233 < ChartAxes
224234 xAxisPoints = { points . xAxis }
225235 yAxisPoints = { points . yAxis }
Original file line number Diff line number Diff line change 66 width : 100% ;
77 height : 100% ;
88
9+ .y-axis-label {
10+ font-size : var (--go-ui-font-size-sm );
11+ fill : var (--go-ui-color-gray-80 );
12+ }
13+
914 .min-max-path {
1015 fill-opacity : 0.5 ;
1116 pointer-events : none;
You can’t perform that action at this time.
0 commit comments