Graph widget: fix off-by-one error in drawing code, inconsistency in smoothing algorithm