Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@holgerfriedrich
Copy link
Member

Support new core feature openhab/openhab-core#4610

Partly fixes openhab/openhab-webui#3277

This is totally untested, I don't have proper dev setup at hand.

Copy link
Member

@mueller-ma mueller-ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So interpolation is a new Sitemap chart parameter that just needs to be added to the URL when getting charts from the server? It case this change would be fine, however since the last release of the app, @maniac103 implemented client-side charts, which should also use this new parameter.

@holgerfriedrich
Copy link
Member Author

Yes, exactly, this is a new parameter to be appended to the URL.
I have done it similar to the yAxisDecimalPattern option, both described here in docs.
I thought I have added interpolation to all places, where yAxisDecimalPattern was used.

I don't know about then new client-side rendering. Maybe @maniac103 could give me some guidance.

@mueller-ma
Copy link
Member

It seems that the client side chart library doesn't support interpolation and it needs to be done manually before sending the values to the chart.

@maniac103
Copy link
Contributor

maniac103 commented Jul 20, 2025

It seems that the client side chart library doesn't support interpolation

It does: there's LineDataSet.setMode(), which allows selecting LINEAR or STEPPED (the former being the default).
So when constructing the data set after loading from persistence API, we can use the value from the widget (which we have at hand there) to select the right mode.

@holgerfriedrich holgerfriedrich force-pushed the pr-chart-interpolation branch from c8c16f0 to 064c514 Compare July 20, 2025 13:10
Signed-off-by: Holger Friedrich <[email protected]>
@holgerfriedrich holgerfriedrich force-pushed the pr-chart-interpolation branch from 064c514 to 92565c1 Compare July 20, 2025 13:17
@holgerfriedrich
Copy link
Member Author

@mueller-ma Should we split this up and fix the server side charts first?

@maniac103 I don't see how I could implement the client-side charts. Would you be willing to guide me, or could you take over the implementation? We still have a few showstoppers for the OH5.0 release to resolve.

@maniac103
Copy link
Contributor

@holgerfriedrich Yes, I can complete this PR, assuming I can push to your branch.

@holgerfriedrich
Copy link
Member Author

Thanks a lot. I added you as a collaborator.

@maniac103
Copy link
Contributor

@holgerfriedrich I added the client side rendering handling. It's untested for now though, as interpolation doesn't seem to be part of the sitemap response:

        {
            "widgetId": "030404",
            "type": "Chart",
            "visibility": true,
            "label": "Füllstand Zisterne (Liter) [5643 l]",
            "labelSource": "ITEM_LABEL",
            "icon": "cistern",
            "staticIcon": false,
            "pattern": "%d l",
            "unit": "",
            "mappings": [

            ],
            "refresh": 1800000,
            "service": "influxdb",
            "period": "3D",
            "item": {
                "link": "http://192.168.100.10:8080/rest/items/CisternFillingLiter",
                "state": "5643.00",
                "stateDescription": {
                    "minimum": 0.0,
                    "maximum": 1.0E+8,
                    "pattern": "%d l",
                    "readOnly": true,
                    "options": [

                    ]
                },
                "lastState": "5638.00",
                "lastStateUpdate": 1753096820370,
                "lastStateChange": 1753096820370,
                "type": "Number",
                "name": "CisternFillingLiter",
                "label": "Füllstand Zisterne (Liter)",
                "category": "cistern",
                "tags": [
                    "Measurement",
                    "Water"
                ],
                "groupNames": [
                    "CisternFillSensor",
                    "GroupPersistenceChartable"
                ]
            },
            "widgets": [

            ]
        }

This is with no explicit interpolation set. I tried to set interpolation (via UI), but Main UI doesn't save the page once I've done that.
I'm running 5.0 RC1. Am I missing something here?

(FWIW, openhab/openhab-core#4610 not making any changes to WidgetDTO seems suspicious to me - after all, that's what the sitemap JSON response is generated from. Also FYI @mherwege )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sitemap interpolation parameter for charts not implemented

3 participants