Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ECharts to v5, add support for ECharts gauge & chart widget #814

Merged
merged 8 commits into from
Jan 27, 2021
Merged
100 changes: 77 additions & 23 deletions bundles/org.openhab.ui/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bundles/org.openhab.ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"cronstrue": "^1.100.0",
"dayjs": "^1.9.6",
"dom7": "^2.1.5",
"echarts": "^4.9.0",
"echarts": "^5.0.1",
"event-source-polyfill": "^1.0.22",
"expression-eval": "^2.1.0",
"framework7": "^5.7.12",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,17 @@ export default {
}
},

'oh-data-series': {
label: 'Data Series',
docLink: 'https://echarts.apache.org/en/option.html#series',
props: {
parameterGroups: [],
parameters: [
seriesTypeParameter('gauge')
]
}
},

'oh-time-series': {
label: 'Time Series',
docLink: 'https://echarts.apache.org/en/option.html#series',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,7 @@
// definitions for the chart page & widgets

import { WidgetDefinition, po } from '../helpers'
import { WidgetDefinition } from '../helpers'

import ChartParameters from '../system/chart'
export const OhChartPageDefinition = () => new WidgetDefinition('oh-chart-page', 'Chart Page', 'Visualize historical series')
.params([
po('chartType', 'Chart Type', 'Define a fixed period for the chart, aligned at the beginning of the period, e.g. January 1st at midnight for a year chart. If not set (or set to dynamic), the length of the period will be configurable but certain combinations like aggregated series might not work', [
{ value: '', label: 'Dynamic period' },
{ value: 'day', label: 'Day' },
{ value: 'isoWeek', label: 'Week (starting on Monday)' },
{ value: 'week', label: 'Week (starting on Sunday)' },
{ value: 'month', label: 'Month' },
{ value: 'year', label: 'Year' }
]).r(),
po('period', 'Initial Period', 'The initial period for the chart', [
{ value: 'h', label: 'h' },
{ value: '2h', label: '2h' },
{ value: '4h', label: '4h' },
{ value: '12h', label: '12h' },
{ value: 'D', label: 'D' },
{ value: '2D', label: '2D' },
{ value: '3D', label: '3D' },
{ value: 'W', label: 'W' },
{ value: '2W', label: '2W' },
{ value: 'M', label: 'M' },
{ value: '2M', label: '2M' },
{ value: '4M', label: '4M' },
{ value: '6M', label: '6M' },
{ value: 'Y', label: 'Y' }
]).v((value, configuration, configDescription, parameters) => {
return !configuration.chartType
})
])
.params(ChartParameters())
Loading