# Dragging annotations

const config = {
  type: 'line',
  plugins: [dragger],
  data,
  options: {
    events: ['mousedown', 'mouseup', 'mousemove', 'mouseout'],
    scales: {
      y: {
        beginAtZero: true,
        min: 0,
        max: 100
      }
    },
    plugins: {
      annotation: {
        enter(ctx) {
          element = ctx.element;
        },
        leave() {
          element = undefined;
          lastEvent = undefined;
        },
        annotations: {
          annotation1,
          annotation2,
          annotation3,
          annotation4
        }
      }
    }
  }
};
Last Updated: 5/15/2023, 12:03:46 PM