Support pie chart export based on alesnav's patch