AbelHeinsbroek/chartjs-plugin-crosshair

Is this repo still maintained?

Closed this issue · 2 comments

Hi there,

I am currently running this plugin with Chart.js 4.2.1. It works for me after some fiddling, but issues likes #118 indicate some difficulties when using recent Chart.js releases. In my case the TypeScript compiler complained about missing definitions but the officially available ones are not compatible with recent Chart.js releases. I then added the definitions myself to get rid of all the warnings thrown by TypeScript with the following file:

chartjs-plugin-crosshair.d.ts

import { Color, ChartType } from 'chart.js';

// options.d.ts
export interface LineOptions {
    color?: Color;
    width?: number
}

export interface CrosshairPluginOptions {
    line?: LineOptions;
}

// index.d.ts
declare module 'chart.js' {
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    interface PluginOptionsByType<TType extends ChartType> {
        crosshair: CrosshairPluginOptions;
    }
}

TLDR; Using the plugin with recent releases of Chart.js causes issues because the repo is not up to speed. To get the repo up to speed we need a maintainer, possibly @AbelHeinsbroek, to review and close open PRs. So, is this repo still maintained?

Ditto, seems like this repo has gone stale.

@ViRuSTriNiTy : That's a hack that may seem like it works. However, the plugin.destroy() function was obsolete in 3.7.0, and needs to be replaced with afterDestroy().

In other words, some reworking needs to be done here :/

I am here to maintain the plugin. A new release has been released for version 4 of chart.js. Will be doing more updates soon to improve Typescript support and more requests.