fix discontinuity bugs in stacked graphs