MCPcopy Create free account
hub / github.com/chartjs/Chart.js / _drawDataset

Method _drawDataset

src/core/core.controller.js:787–813  ·  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

785 * @private
786 */
787 _drawDataset(meta) {
788 const ctx = this.ctx;
789 const args = {
790 meta,
791 index: meta.index,
792 cancelable: true
793 };
794 // @ts-expect-error
795 const clip = getDatasetClipArea(this, meta);
796
797 if (this.notifyPlugins('beforeDatasetDraw', args) === false) {
798 return;
799 }
800
801 if (clip) {
802 clipArea(ctx, clip);
803 }
804
805 meta.controller.draw();
806
807 if (clip) {
808 unclipArea(ctx);
809 }
810
811 args.cancelable = false;
812 this.notifyPlugins('afterDatasetDraw', args);
813 }
814
815 /**
816 * 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