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

Method _drawDataset

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

860 * @private
861 */
862 _drawDataset(meta) {
863 const ctx = this.ctx;
864 const args = {
865 meta,
866 index: meta.index,
867 cancelable: true
868 };
869 // @ts-expect-error
870 const clip = getDatasetClipArea(this, meta);
871
872 if (this.notifyPlugins('beforeDatasetDraw', args) === false) {
873 return;
874 }
875
876 if (clip) {
877 clipArea(ctx, clip);
878 }
879
880 meta.controller.draw();
881
882 if (clip) {
883 unclipArea(ctx);
884 }
885
886 args.cancelable = false;
887 this.notifyPlugins('afterDatasetDraw', args);
888 }
889
890 /**
891 * 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