When visualizing query plan alone, the `chartElement[0][0]` is null, so make `chartElement` to `null`. And check `null` or not whenever `chartElement` is used. This is like a work round to prevent `chartElement` undefined error when using plan vis alone.