Skip to content

Commit

Permalink
Merge 60f11c9 into 2f8e785
Browse files Browse the repository at this point in the history
  • Loading branch information
Flix6x committed Sep 14, 2023
2 parents 2f8e785 + 60f11c9 commit f4d9b5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions documentation/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ New features

* Introduce new reporter to compute profit/loss due to electricity flows: `ProfitOrLossReporter` [see `PR #808 <https://github.com/FlexMeasures/flexmeasures/pull/808>`_ and `PR #844 <https://github.com/FlexMeasures/flexmeasures/pull/844>`_]
* Charts visible in the UI can be exported to PNG or SVG formats in a more automated fashion, using the new CLI command flexmeasures show chart [see `PR #833 <https://github.com/FlexMeasures/flexmeasures/pull/833>`_]
* Sensor charts showing instantaneous observations can be interpolated by setting the ``interpolate`` sensor attribute to one of the `supported Vega-Lite interpolation methods <https://vega.github.io/vega-lite/docs/area.html#properties>`_ [see `PR #850 <https://github.com/FlexMeasures/flexmeasures/pull/850>`_]

Infrastructure / Support
----------------------
Expand Down
10 changes: 8 additions & 2 deletions flexmeasures/data/models/charts/belief_charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@ def bar_chart(
event_ends_before.timestamp() * 10**3,
]
}
mark_type = "bar"
mark_interpolate = None
if sensor.event_resolution == timedelta(0) and sensor.has_attribute("interpolate"):
mark_type = "area"
mark_interpolate = sensor.get_attribute("interpolate")
chart_specs = {
"description": "A simple bar chart showing sensor data.",
"description": f"A simple {mark_type} chart showing sensor data.",
# the sensor type is already shown as the y-axis title (avoid redundant info)
"title": capitalize(sensor.name) if sensor.name != sensor.sensor_type else None,
"layer": [
{
"mark": {
"type": "bar",
"type": mark_type,
"interpolate": mark_interpolate,
"clip": True,
"width": {"band": 0.999},
},
Expand Down

0 comments on commit f4d9b5f

Please sign in to comment.