Dynamic resampling based on chart width

Signed-off-by: Oleg Bulatov <dmage@yandex-team.ru>