When printing a Blazor WASM Pie Chart, it looses all colors associated with it. Attached are pictures before and after printing and the javascript used for printing along with my markup.
Before print:
After print:
Javascript:
function printChartAreaDiv() {
var divContents = document.getElementById("chartPrintArea").innerHTML;
var a = window.open('', '', 'height=500, width=500');
a.document.write('<html>');
a.document.write('<body > <br>');
a.document.write(divContents);
a.document.write('</body></html>');
a.document.close();
a.print();
}
Markup being printed that contains the piechart:
<div id="chartPrintArea" class="row">
<PieChartComponent @ref="chart"
ReportObjectId=@ReportObject.Id
StartTime=@_startTime.Value
EndTime=@_endTime.Value />
</div>
PieChartComponent:
@if (_loading)
{
<Chase style="margin-top:75px" Center="true" />
}
else
{
<RadzenChart>
<RadzenPieSeries Data="@_values" CategoryProperty="Name" Title=@_reportObject.Title
ValueProperty="Value" />
</RadzenChart>
}