[SOLVED] Main UI: Show/Call/Raise chart from Layout page

Hi,
I am running OpenHAB 5.1.1 in a docker container on my NAS and have the intention to migrate away from HABPanel this year. What I really like with HABPanel is to easily integrate charts into the panel pages and have the same comfort configuring it as in the chart pages e. g. to have more than one item in a chart and individually adjust the axis.

I know that I can create a chart page for the Main UI but I would like to have it as part of a layout page or at least a direct link that I can click from the layout page to get to this chart.

With a tremendous support from a forum I got help in the past to create my own chart widget but it only fit into one predefined layout and as I am not such a great programmer, I do not know how to use and adjust it for other pages.

I was wondering if there are similar requests as mine from others or if the community sees the value for having charts in layout pages to have it as an official feature?
Maybe it is not too complicated to add a link to a chart page into a layout page … whatever.

Thank youfro your thoughts and feedback on my request.

Cheers
Justus

Many widget types including cells and cards and list items can be configured with actions that link to other OH pages. So the simplest ting to do is to create each chart page and then add a cell (or which ever you prefer) to your layout page and configure the cell to have an navigate action.

If you want the chart to be on the layout page itself then you are going to have to do just a little work with the the code tab on a page or the widget editor, but not much. You can still create the a chart using all the wizards on the chart page. Then, when you have it looking the way you want copy all the yaml text from that page’s code tab. That yaml starts with config: and that is all the configuration for an oh-chart component. So for example, ig you wanted that shart to show up on a card, you could just go to the widget editor and change the default widget text to be:

uid: myChartCard <-- always change the random uid
props:
  parameterGroups: []
  parameters:
    - name: prop1
      label: Prop 1
      type: TEXT
      description: A text prop
    - name: item
      label: Item
      type: TEXT
      context: item
      description: An item to control
tags: []
component: f7-card
config:
  title: Chart card
slots:
  default:
    - component: oh-chart
      config: <--start of pasted text
...rest of the config follows here

If you save that widget then go to a layout page editor you can add that widget any place in a loayout you could already put a card.

1 Like

The only thing I’ll add is any read only widget (i.e. and widget that represents a sensor value like oh-label-card) will have an Action property. You can set the action to “Analyze” and select more than one Item and set some other chart properties. This will bring up the chart when clicking on the widget. You don’t necessarily need to create a whole separate Chart page and navigate to that in all cases.

I don’t know if you have access to the full set of properties as you would have with an oh-chart in this case though.

If you use the semantic model, you can see this in action (pun intended) on the Properties tab of the Overview page when clicking on “Analyze All”. But you can configure this on any widget that supports Action. I believe the default for many widgets is to bring up a chart of the one Item even if you don’t configure anything special.

1 Like

@JustinG
@rlkoshak

THANK YOU!

That is a great feedback. That looks feasible even for me. I will try it next weekend as I am on business travel this week. I will test it out also regarding chart size and if the supplement of Rich is the better to click on the widget to open the chart in full size.

Thanks for your great advice :clap:t2:

Hey @JustinG,
that is alread what satisfies my needs and expectations. Awesome :clap:
It is absolutely ok for my to “craft” a chart with all the content and dependencies of item that I like to see but I was looking for the comfort not to search, find and select it out of context from the sidebar but replacing the single item analysis (chart of only one item) with the more complex chart created with a chart page. This also reduces the necessity to put the chart pages on the side bar :+1:

This was so simple that I should have found it on my own. So, thank you for taking the time and guiding me to it. I will try harder next time to discover such questions on my own. The good thing is that it is now visible to other “seekers” :slight_smile:

THANK YOU - problem solved !!!