Experimenting with different color for export

This commit is contained in:
Gunnar Skjold 2023-09-24 07:41:14 +02:00
parent 545be710ba
commit f459b0af14
6 changed files with 26 additions and 24 deletions

File diff suppressed because one or more lines are too long

View File

@ -99,14 +99,14 @@
y="{yScale(0)}"
width="{barWidth - 4}"
height="{yScale(config.y.min) - yScale(config.y.min + point.value2)}"
fill="{point.color}"
fill="{point.color2 ? point.color2 : point.color}"
/>
{#if barWidth > 15}
<text
width="{barWidth - 4}"
dominant-baseline="middle"
text-anchor="{'middle'}"
fill="{yScale(-point.value2) < yScale(0) + 15 ? point.color : 'white'}"
fill="{yScale(-point.value2) < yScale(0) + 15 ? point.color2 ? point.color2 : point.color : 'white'}"
transform="translate({xScale(i) + (barWidth/2)} {yScale(-point.value2) < yScale(0) + 15 ? yScale(-point.value2) + 15 : yScale(-point.value2) - 14}) rotate({barWidth < vertSwitch ? 90 : 0})"
>{point.label2}</text>
{#if point.title2}

View File

@ -112,7 +112,6 @@ export async function shiftPrices() {
pricesStore.update(p => {
for(var i = 0; i < 36; i++) {
if(p[zeropad(i)] == null) {
console.log(i);
fetchUpdate = i < 12;
break;
}

View File

@ -1,5 +1,5 @@
<script>
import { zeropad, addHours } from './Helpers.js';
import { zeropad, addHours, exportcol } from './Helpers.js';
import BarChart from './BarChart.svelte';
export let json;
@ -34,7 +34,8 @@
label2: exp.toFixed(1),
title2: exp.toFixed(2) + ' kWh',
value2: exp*10,
color: '#7c3aed'
color: '#7c3aed',
color2: '#37829E'
});
min = Math.max(min, exp*10);
max = Math.max(max, imp*10);
@ -56,7 +57,8 @@
label2: exp.toFixed(1),
title2: exp.toFixed(2) + ' kWh',
value2: exp*10,
color: '#7c3aed'
color: '#7c3aed',
color2: '#37829E'
});
min = Math.max(min, exp*10);
max = Math.max(max, imp*10);
@ -77,7 +79,6 @@
label: (val/10).toFixed(1)
});
}
console.log(yTicksNum);
}
max = Math.max((range/4), max);

View File

@ -1,5 +1,5 @@
<script>
import { zeropad, addHours } from './Helpers.js';
import { zeropad, addHours, exportcol } from './Helpers.js';
import BarChart from './BarChart.svelte';
export let json;
@ -37,7 +37,8 @@
label2: exp.toFixed(exp < 10 ? 1 : 0),
title2: exp.toFixed(2) + ' kWh',
value2: exp,
color: '#7c3aed'
color: '#7c3aed',
color2: '#37829E'
});
min = Math.max(min, exp);
max = Math.max(max, imp);
@ -58,7 +59,8 @@
label2: exp.toFixed(exp < 10 ? 1 : 0),
title2: exp.toFixed(2) + ' kWh',
value2: exp,
color: '#7c3aed'
color: '#7c3aed',
color2: '#37829E'
});
min = Math.max(min, exp);
max = Math.max(max, imp);

View File

@ -17,18 +17,18 @@ export default defineConfig({
plugins: [svelte()],
server: {
proxy: {
"/data.json": "http://192.168.233.209",
"/energyprice.json": "http://192.168.233.209",
"/dayplot.json": "http://192.168.233.209",
"/monthplot.json": "http://192.168.233.209",
"/temperature.json": "http://192.168.233.209",
"/sysinfo.json": "http://192.168.233.209",
"/configuration.json": "http://192.168.233.209",
"/tariff.json": "http://192.168.233.209",
"/save": "http://192.168.233.209",
"/reboot": "http://192.168.233.209",
"/configfile": "http://192.168.233.209",
"/upgrade": "http://192.168.233.209"
"/data.json": "http://192.168.233.235",
"/energyprice.json": "http://192.168.233.235",
"/dayplot.json": "http://192.168.233.235",
"/monthplot.json": "http://192.168.233.235",
"/temperature.json": "http://192.168.233.235",
"/sysinfo.json": "http://192.168.233.235",
"/configuration.json": "http://192.168.233.235",
"/tariff.json": "http://192.168.233.235",
"/save": "http://192.168.233.235",
"/reboot": "http://192.168.233.235",
"/configfile": "http://192.168.233.235",
"/upgrade": "http://192.168.233.235"
}
}
})