Closed dagwud closed 2 years ago
I know I hate bug reports, so first and foremost - thank you for your hard work in integrating with Apex Charts - this is a really, really useful addon!!
FYI, here’s a more complex example of the same problem with real data. This one requires specific sensor values to reproduce though, which is why I added the simplified example.
type: custom:apexcharts-card
header:
show: true
title: Consumption
show_states: true
colorize_states: true
graph_span: 12h
all_series_config:
stroke_width: 2
type: area
curve: stepline
stacked: true
series:
- entity: sensor.solarman_daily_production_active
name: Solar Generation
transform: return -x
- entity: sensor.daily_bedroom_geyser_consumption
name: Bedroom Geyser
- entity: sensor.daily_kitchen_geyser_consumption
name: Kitchen Geyser
- entity: sensor.daily_pool_consumption
name: Pool
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity.
Checklist
Describe the bug With stacked area graphs, negative values cause the graph to be hard to read.
When all values are positive, the graph appears to render the first series, then the second series above it (on y axis) and so on.
However, if the value of the first series is negative then things get strange with respect to the area shading. In my case, the first series is total grid electricity consumption, which can be negative if my solar panels are pushing more power out than my house is consuming.
Specifically, the first series renders below the y=0 line (correctly) but the shading of the area extends upwards to the y=0 line. This means that subsequent series’ areas are rendered in a place that is already shaded by the first series’ negative values, causing areas where there is shading for multiple series that overlap. This leads to portions of the second/third/etc. series that are hard to read because they’re obscured by the first series’ shading.
Version of the card Version: v1.10.0
To Reproduce This is a simplified example to show the scenario, using data generators so you don’t need any specific sensor values. The screenshots attached reflect this example.
This renders three simple mathematical formulae and stacks them. I added stepline to make it easier to see the issue. Note how to the right side of the graph, the shadings for the areas overlap, and become harder to see as more areas overlap.
Screenshots Note the area from around 4pm where the overlapping shading occurs. If you look very carefully you can still see the lines from the other series, but they’re very hard to see because of the orange series’ shading.
Expected behavior If the value of a series is negative, all values in the stacked graph should still be readable. One possibility might be to have the negative value be excluded from shading, ie have it have a shaded height of 0 for all points where y < 0
Smartphone (please complete the following information):