MCPcopy
hub / github.com/chartjs/Chart.js / _drawDataset

Method _drawDataset

src/core/core.controller.js:783–809  ·  view source on GitHub ↗

* Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw` * hook, in which case, plugins will not be called on `afterDatasetDraw`. * @private

(meta)

Source from the content-addressed store, hash-verified

781 * @private
782 */
783 _drawDataset(meta) {
784 const ctx = this.ctx;
785 const args = {
786 meta,
787 index: meta.index,
788 cancelable: true
789 };
790 // @ts-expect-error
791 const clip = getDatasetClipArea(this, meta);
792
793 if (this.notifyPlugins('beforeDatasetDraw', args) === false) {
794 return;
795 }
796
797 if (clip) {
798 clipArea(ctx, clip);
799 }
800
801 meta.controller.draw();
802
803 if (clip) {
804 unclipArea(ctx);
805 }
806
807 args.cancelable = false;
808 this.notifyPlugins('afterDatasetDraw', args);
809 }
810
811 /**
812 * Checks whether the given point is in the chart area.

Callers 1

_drawDatasetsMethod · 0.95

Calls 5

notifyPluginsMethod · 0.95
getDatasetClipAreaFunction · 0.85
clipAreaFunction · 0.85
unclipAreaFunction · 0.85
drawMethod · 0.65

Tested by

no test coverage detected