Skip to content

Commit

Permalink
Merge pull request #59 from code4policy/defaultbutton
Browse files Browse the repository at this point in the history
Fixed the default button!
  • Loading branch information
samho11 authored Jan 15, 2024
2 parents c30a5d4 + 5ec9f2a commit 17e6c50
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
6 changes: 3 additions & 3 deletions version2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ <h1>Who's Winning?</h1>
<option value="government_revenue">Government Revenue (% of GDP)</option>
<option value="GDP_per_capita">GDP per Capita (USD)</option>
<option value="military_expenditure">Military Expenditure (in mill USD)</option>
<option value="tourist_arrivals" selected>International Tourist Arrivals</option>
<option value="tourist_arrivals" >International Tourist Arrivals</option>
<option value="dog_ownership">Dog Ownership</option>
<option value="cat_ownership">Cat Ownership</option>
<option value="movie_production">Number of Movies Produced</option>
<option value="box_office_numbers" selected>Global Box Office (in USD)</option>
<option value="box_office_numbers" >Global Box Office (in USD)</option>
<option value="air_quality">Air Quality</option>
<option value="happiness">Happiness Score</option>
<option value="life_expectancy">Life Expectancy at Birth</option>
<option value="mean_years_of_schooling" selected>Mean Years of Schooling</option>
<option value="mean_years_of_schooling" >Mean Years of Schooling</option>
<option value="income_per_capita">Income per Capita</option>
<option value="gender_inequality">Gender Inequality Index</option>
<option value="forest_area">Forest Area (Sq. km)</option>
Expand Down
22 changes: 11 additions & 11 deletions version2/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,46 @@ function updateChart() {
var chartSubheader = document.getElementById('chart-subheader');

if (yVariable === 'trade_balance') {
chartHeader.innerText = 'Top 10 Countries by Trade Balance';
chartHeader.innerText = 'Top 10 Countries by Trade Balance (% of GDP)';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'government_revenue') {
chartHeader.innerText = 'Top 10 Countries by Government Revenue as a % of GDP';
chartHeader.innerText = 'Top 10 Countries by Government Revenue (% of GDP)';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'GDP_per_Capita') {
chartHeader.innerText = 'Top 10 Countries by GDP per capita (USD)';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'military_expenditure') {
chartHeader.innerText = 'Top 10 Countries by Military Expenditure';
chartHeader.innerText = 'Top 10 Countries by Military Expenditure (USD)';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'tourist_arrivals') {
chartHeader.innerText = 'Top 10 Countries by Tourist Arrivals';
chartHeader.innerText = 'Top 10 Countries by Number of Tourist Arrivals';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'dog_ownership') {
chartHeader.innerText = 'Top 10 Countries by Dog Ownership';
chartHeader.innerText = 'Top 10 Countries by Number of Dog Owners';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'cat_ownership') {
chartHeader.innerText = 'Top 10 Countries by Cat Ownership';
chartHeader.innerText = 'Top 10 Countries by Number of Cat Owners';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'movie_production') {
chartHeader.innerText = 'Top 10 Countries by Number of Movies';
chartHeader.innerText = 'Top 10 Countries by Number of Movies Made';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'box_office_numbers') {
chartHeader.innerText = 'Top 10 Countries by Box Office Numbers';
chartHeader.innerText = 'Top 10 Countries by Box Office Sales (USD)';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'air_quality') {
chartHeader.innerText = 'Top 10 Countries by Air Quality';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'happiness') {
chartHeader.innerText = 'Top 10 Happiest Countries';
chartHeader.innerText = 'Top 10 Happiest Countries (Comparative Index)';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'life_expectancy') {
chartHeader.innerText = 'Top 10 Countries by Life Expectancy';
chartHeader.innerText = 'Top 10 Countries by Life Expectancy (Years)';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'mean_years_of_schooling') {
chartHeader.innerText = 'Top 10 Countries by Mean Years of Schooling';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'income_per_capita') {
chartHeader.innerText = 'Top 10 Countries by Income per Capita';
chartHeader.innerText = 'Top 10 Countries by Income per Capita (USD)';
chartSubheader.innerText = 'According to data from xxx';
} else if (yVariable === 'gender_inequality') {
chartHeader.innerText = 'Top 10 Countries by Gender Inequality';
Expand Down
5 changes: 4 additions & 1 deletion version2/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,16 @@ select#yVariableSelect {
padding: 5px; /* Add padding for better visibility and clickability */
font-size: 12px; /* Adjust font size */
margin-top: 10px; /* Adjust margin as needed */
font-weight:normal;
}

#chart-container-wrapper {
display: none;
font-size: 30px;
font-size:25px;
font-weight: bold;
}


#chart-container {
font-family: 'Lato', sans-serif;
/* display: none;*/
Expand Down

0 comments on commit 17e6c50

Please sign in to comment.