For me, sending an empty array in the payload (to clear the chart), in the ui_control message did it.
I also determined that if you set some of the bar chart options up for the bar chart (scales and axes) that these conflict with the line graph, so in the ui_control message I also had to set options: {}
. See this thread for more details. Line chart not display after switch to bar and back to line