Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispahm committed Dec 4, 2019
1 parent 3c55fc8 commit 07a3c90
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 13 deletions.
2 changes: 1 addition & 1 deletion components/crop_shares.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@ export default {
.cropShares-wrapper {
margin: auto;
text-align: center;
margin-top: 80px;
margin-top: 30px;
}
</style>
14 changes: 14 additions & 0 deletions components/time_series.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,20 @@ export default {
e.target.style.cursor = 'grabbing'
}
timeseries.options.onDragEnd = this.saveChanges
timeseries.options.tooltips = {
callbacks: {
label: function(tooltipItem, data) {
let label = data.datasets[tooltipItem.datasetIndex].label || ''
if (label) {
label += ': '
}
label += Math.round(tooltipItem.yLabel * 100) / 100
return label
}
}
}
}
},
getData(data, category, type) {
Expand Down
4 changes: 2 additions & 2 deletions pages/plot-overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@
<br>
Alternativ können Sie Daten aus dem vorherigen Anbaujahr importieren.
</h3>
<button @click="$nuxt.$router.replace({path: 'maps'})">
<button class="button" @click="$nuxt.$router.replace({path: 'maps'})">
ZUR KARTE
</button>
<button style="margin-left: 20px;" @click="importPrev">
<button style="margin-left: 20px;" class="button" @click="importPrev">
IMPORTIEREN
</button>
</div>
Expand Down
40 changes: 30 additions & 10 deletions pages/results.vue
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,14 @@
</tbody>
</table>
<div class="plots-wrapper">
<select v-model="cropYearSwitcher" class="selection select crop-year-switcher" name="">
<option value="selectedCrop">
Planungsjahr
</option>
<option value="prevCrop1">
Vorjahr
</option>
</select>
<cropShares :shares="curShares" />
<deviationOptimum :shares="shares" :plots="curPlots" :time="curTimeReq" :total="grossMarginCurYear" />
<div style="width: 400px;">
Expand Down Expand Up @@ -416,6 +424,7 @@ export default {
renderResultsMap: false,
totLand: 0,
sortKey: '',
cropYearSwitcher: 'selectedCrop',
manure: undefined,
shares: {},
resultMapSwitcher: 'Kulturen',
Expand Down Expand Up @@ -501,15 +510,19 @@ export default {
}
*/
const colors = [
'#79AE98',
'#D6E5CD',
'#ECCB89',
'#D48544',
'#9B643B',
'#9DD5C0',
'#B5DCE1',
'#D0D1D3',
'#B5DCE1'
'#79ae98',
'#d6e5cd',
'#eccb89',
'#d48544',
'#9b643b',
'#8db867',
'#9dd5c0',
'#a9dbd4',
'#b5dce1',
'#c3d1da',
'#d0d1d3',
'#daccc3',
'#b5dce1'
]
/*
const colors = [
Expand All @@ -528,7 +541,7 @@ export default {
const o = {}
if (!this.curPlots) return o
this.curPlots.forEach(plot => {
const selectedCrop = plot.selectedCrop // plot.prevCrop1
const selectedCrop = plot[this.cropYearSwitcher] // plot.prevCrop1
if (!selectedCrop) return
if (!o[selectedCrop]) {
o[selectedCrop] = {
Expand Down Expand Up @@ -1005,6 +1018,13 @@ export default {
margin-bottom: 10px;
}
.crop-year-switcher {
margin-top: 50px;
width: 175px;
margin-left: 25px;
font-size: 18px;
margin-bottom: 10px;
}
@media (max-width: 1250px) {
.plot-selection {
width: 125px;
Expand Down

0 comments on commit 07a3c90

Please sign in to comment.