Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ swiper-slide {
option {
color: blue;
}
.ttarea .ttmessage {visibility: hidden}
.ttarea .ttmessage {visibility: hidden;}
.ttarea:hover .ttmessage {
visibility: visible;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
fill="var(--color-bg)"
opacity="90%"
stroke="var(--color-menu)"
stroke-width="1"
/>

<text
text-anchor="start"
x="5"
Expand Down Expand Up @@ -105,7 +107,7 @@
:width="boxwidth"
/>
<PgToolTipLine
v-if="globalConfig.showPrices"
v-if="etData.active"
cat="price"
:indent="5"
:power="entry.price"
Expand All @@ -120,7 +122,7 @@
import type { ScaleTime } from 'd3'
import { timeFormat } from 'd3'
import { itemNames, type GraphDataItem } from './model'
import { globalConfig } from '@/assets/js/themeConfig'
import { etData } from '@/components/priceChart/model'
import PgToolTipLine from './PgToolTipLine.vue'

const props = defineProps<{
Expand All @@ -129,11 +131,13 @@ const props = defineProps<{
xScale: ScaleTime<number, number>
}>()

//function linecount() {
// return Object.values(props.entry).filter((v) => v > 0).length
//}
function height() {
return Object.values(props.entry).filter((v) => v > 0).length * 18 + 40
return (
Object.entries(props.entry).filter(
([k, v]) =>
k != 'selfUsage' && !k.startsWith('soc') && v != null && v > 0,
).length * 20 + 2
)
}
function pvs() {
return Object.entries(props.entry)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>
{{ name ? name : masterData[cat].icon }} &nbsp;
</tspan>
<tspan text-anchor="end" :x="width - indent">
<tspan text-anchor="end" :x="width - 5">
<FormatWatt v-if="cat != 'price' && props.power > 0" :watt="power * 1000" />
<tspan v-if="cat === 'price'">{{ formatPrice(props.power) }}</tspan>
</tspan>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@
:origin="autozoom"
:transform="'translate(' + margin.left + ',' + margin.top + ')'"
>
<g v-for="d in data" :key="d.date" class="ttarea">
<g v-for="d in data" :key="d.date" class="ttitems">
<PgToolTipItem
v-if="popupToShow == d.date"
:entry="d"
:boxwidth="boxwidth"
:x-scale="xScale2"
></PgToolTipItem>
</g>
<g
v-for="d in data"
:key="d.date"
class="ttarea"
@mouseleave="popupToShow = 0"
>
<rect
:x="xScale(d.date)"
y="0"
Expand All @@ -13,18 +26,14 @@
:width="graphData.data.length > 0 ? width / graphData.data.length : 0"
opacity="1%"
fill="var(--color-charging)"
@mouseover="showPopup(d.date)"
></rect>
<PgToolTipItem
:entry="d"
:boxwidth="boxwidth"
:x-scale="xScale2"
></PgToolTipItem>
</g>
</g>
</template>
<script setup lang="ts">
import { extent, scaleTime, scaleUtc, select } from 'd3'
import { computed } from 'vue'
import { computed, ref } from 'vue'
import { graphData, zoomedRange, type GraphDataItem } from './model'
import PgToolTipItem from './PgToolTipItem.vue'

Expand All @@ -35,6 +44,7 @@ const props = defineProps<{
data: GraphDataItem[]
}>()
const boxwidth = 140
const popupToShow = ref(0)
const xScale = computed(() => {
const e = extent(props.data, (d) => new Date(d.date))
if (e[0] && e[1]) {
Expand Down Expand Up @@ -73,5 +83,8 @@ const autozoom = computed(() => {
}
return 'PgToolTips.vue:autozoom'
})
function showPopup(d: number) {
popupToShow.value = d
}
</script>
<style scoped></style>
Loading