Graph: fix for legends on the side and graph dimensions adaptation