UPDATE: The most current information on this topic is now available at: User Interface Design Overview | openHAB. The following is kept for archival purposes only!
The persistence database rrd4j comes installed by default and we recommend configuring rrd4j as the default persistence and configured to save everything. There is a reason for this. In MainUI you will find scattered here and there a button labeled “Analyze”. Clicking on that will generate a chart of what ever you are looking at. Here is the chart I see when I click on “Analyze All” on a Humidity card in the “Properties” tab of the Overview Page which is built from the model. I show this because I didn’t set anything up to generate this chart. All I had to do was build the semantic model so my humidity sensors are properly tagged and make sure the humidity Items are saved to the default persistence.
You can change how the chart looks in controls and change the time period by clicking D in the upper right corner.
You can even put the chart of an Item behind the Item’s card so no matter where you look at it you can see a history of it’s state.
And there’s that “Analyze” button again.
I bring these up to point out that a lot of charting capability “just happens”. You don’t have to do much of anything to get them.
If you want to create a chart manually though, go to Settings -> Pages and click the + icon at the bottom right. Choose “Chart” from the list.
To create a simple line chart:
- give it a reasonable ID, Label, and set the visibility settings as desired.
- Change the Chart Type and Initial Period as desired.
- Add Grid
a. Click the + in the upper left to add the Y-axis, click the newly created axis to configure it
b. Click the + in the lower right to add the X axis, click the newly created axis to configure it
c. Click “Add Time Series” and then click the menu to edit the series
d. Choose the Item and other charting parameters for that time series.
e. Repeat c-d for all the Items you want to chart.
f. You can add additional components like tool tips, a legend, title, etc at the bottom.
Repeat 3 to add additional charts to the page.
At any time you can toggle the live view in the bottom right corner or by typing ctrl-r.
Save the page as you go (ctrl-s, button at top right).
When done, depending on the settings you chose, you will see a new entry in the left menu for the new chart page.