How to charting Contact and Switch Items?

In OH1 conversion ON/OFF to 1/0 was automatic.
How to chart Contact and Switch Items?
Or i must use only Number items if i want to view charts?

for rrd4j yes

so,you might use another persistence or eg add a second item for your window

number kitchenwindow_bool …

I use JDBC MariaDB (mysql).
Is it possible to turn on that conversion like in OH1?