legendFunc={
return function legendFunc(plot,totals){
d3.select(plot).select('.bitcoin-legend-swatches').style('margin','175px auto').style('border','1px solid grey').insert("div",":first-child").style('color','white')
.style('font-size','18px').style('text-align','center').style('border-bottom','1px solid white').text("Avg Q2'23 Volume")
let legend_rows = d3.select(plot).selectAll(".bitcoin-legend-swatch-label")
.append('div').attr('class','legend-row').style('color','white');
let name_yoy = legend_rows.append('div').attr('class','legend-name');
let name_yoy_name = name_yoy.append('div').attr('class','name').style('font-size','18px').text(d=>d);
let name_yoy_change = name_yoy.append('div').attr('class','name').text('QoQ change')
let name_total = legend_rows.append('div').attr('class','legend-total').style('margin-left','auto');
let name_total_total = name_total.append('div').attr('class','total')
.style('font-size','18px')
.text(d=>totals[d] >10000000?"$"+ Math.round(Math.round(totals[d])/1000000)+"M":
"$"+ Math.round(Math.round(totals[d])/100000)/10+"M" );
let name_total_change = name_total.append('div').attr('class','name').style('text-align','end').text('N/A')
d3.select(plot).selectAll('.bitcoin-legend-swatch').selectAll('rect').attr('rx','8px')
d3.select(plot).selectAll('.legend-row').style('width','200px').style('display','flex')
}
}