Embed-chart enhancements

See commit list and ticket 21467 for changes.