Chart regional settings (locale?: since ECHARTS 5.0.0)

My understanding is, that OpenHab provides the possibility to design charts with the ‘page chart tool’ within pages (pages → create chart) or with widgets within pages (component: oh-chart, component: oh-aggregate-series, …). Both methods work with ECHARTS.

The problem is that both methods use different regional settings – in my case ‘English’ for charts created with ‘page chart tool’ in pages and ‘Austria/German’ for charts created with widgets within pages.

A chart created with page chart tool within pages: the charts use the regional settings ‘English’:


English: May

A chart created with widgets in pages: the charts use the regional settings of the system (in my case regional settings ‘Austria/German’):


Austria: Jän. = Jänner, German: Jan. = Januar, English: Jan. = January

In the ECHART documentation https://echarts.apache.org/en/api.html#echarts I found the following information:

echarts
Global echarts object, which can be accessed after including echarts.js in script tag or through require(‘echarts’) in AMD environment.
Properties
echarts. init
Function
(dom: HTMLDivElement|HTMLCanvasElement, theme?: Object|string, opts?: {
devicePixelRatio?: number,
renderer?: string,
useDirtyRect?: boolean, // Since 5.0.0
useCoarsePointer?: boolean, // Since 5.4.0
pointerSize?: number, // Since 5.4.0
ssr?: boolean, // Since 5.3.0
width?: number|string,
height?: number|string,
locale?: string // Since 5.0.0
}) => ECharts

Creates an ECharts instance, and returns an echartsInstance. You shall not initialize multiple ECharts instances on a single container.

Parameters

  • locale Specify the locale

There are two builtins: ‘ZH’ and ‘EN’. Or you can use echarts.registerLocale to register a new locale. Or supported locales can be referenced in src/i18n.

In the OpenHab documentation 4.1 I found a document about Internationalization

All texts can be internationalized by using Java i18n properties files.

Please explain the reason for this different behavior on the same system and the same tabbed page.

I don’t think this is the intended behavior. This looks to me like you should file an issue in the UI repository.

Thank you for your advice. I have filed an issue in the UI repository.
… the problem seems to be that the chart tool in pages does not recognize the regional settings of the system. As a workaround I have put my two lines into the page with widgets.

1 Like