mirror of
https://github.com/pezkuwichain/pezkuwi-sdk-ui.git
synced 2026-07-13 03:25:45 +00:00
Initial commit: Pezkuwi SDK UI
Comprehensive web interface for interacting with Pezkuwi blockchain. Features: - Blockchain explorer - Wallet management - Staking interface - Governance participation - Developer tools Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
// Copyright 2017-2026 @pezkuwi/react-components authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ChartType, Plugin } from 'chart.js';
|
||||
|
||||
import { CategoryScale, Chart, LinearScale, LineElement, PointElement, Title, Tooltip } from 'chart.js';
|
||||
import annotationPlugin from 'chartjs-plugin-annotation';
|
||||
import crosshairPlugin from 'chartjs-plugin-crosshair';
|
||||
|
||||
import Doughnut from './Doughnut.js';
|
||||
import HorizBar from './HorizBar.js';
|
||||
import Line from './Line.js';
|
||||
|
||||
interface CrosshairChart {
|
||||
crosshair?: boolean;
|
||||
}
|
||||
|
||||
function CustomCrosshairPlugin (plugin: Plugin<ChartType>): Plugin<ChartType> {
|
||||
const originalAfterDraw = plugin.afterDraw;
|
||||
|
||||
if (originalAfterDraw) {
|
||||
plugin.afterDraw = function (chart, args): void {
|
||||
if ((chart as CrosshairChart).crosshair) {
|
||||
// @ts-expect-error - Pass exactly what the original plugin expects
|
||||
originalAfterDraw.call(this, chart, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return plugin;
|
||||
}
|
||||
|
||||
Chart.register(
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
LineElement,
|
||||
PointElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
annotationPlugin,
|
||||
CustomCrosshairPlugin(crosshairPlugin as Plugin<ChartType>)
|
||||
);
|
||||
|
||||
export default {
|
||||
Doughnut,
|
||||
HorizBar,
|
||||
Line
|
||||
};
|
||||
Reference in New Issue
Block a user