Home Forums Chart Support Multi Series Range Stacked Chart Reply To: Multi Series Range Stacked Chart

#61035

Shannon,

When exporting a CanvasJS chart, only the native chart elements are included in the exported image. Custom DOM elements, such as external legends, are not part of the chart and therefore won’t appear in the export.

If your goal is to display custom legends and include them in the exported image, one workaround is to use dummy dataseries to represent those legends within the chart itself. This way, they become part of the chart and will be included in the export. Please checkout the code-snippet demonstrating how to create a dummy series for this purpose:

{
	type: "scatter",
	showInLegend: true,
	legendText: "Dummy Legend",
	legendMarkerType: "square",
	legendMarkerColor: "red",
	dataPoints: [{}] // Empty datapoint
}

This approach ensures that your custom legend appears in the chart area and is included when exporting.


Vishwas R
Team CanvasJS