Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [unreleased]

### Changed
- Clean up mixed Chartist imports

----

## [2.0.0] - 18th April 2026

### Changed
Expand Down
9 changes: 4 additions & 5 deletions src/scripts/chartist-plugin-tooltip.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as Chartist from 'chartist';
import {BarChart, BaseChart, PieChart, PieChartOptions} from 'chartist';
import {extend, BarChart, BaseChart, PieChart, PieChartOptions} from 'chartist';

/**
* Tooltip plugin options.
Expand Down Expand Up @@ -62,7 +61,7 @@ export default function ChartistPluginTooltip<T extends BaseChart<any>>(
chart: T,
options?: Partial<Options>
): void {
const defaultOptions = {
const defaultOptions: Options = {
tooltipOffset: {
x: 0,
y: -20
Expand All @@ -76,7 +75,7 @@ export default function ChartistPluginTooltip<T extends BaseChart<any>>(
metaIsHTML: false
};

const $options = Chartist.extend({}, defaultOptions, options) as Options;
const $options: Options = extend({}, defaultOptions, options);

// Warning: If you are using npm link or yarn link, these instanceof checks will fail and you won't get any tooltips
let tooltipSelector = $options.pointClass || '';
Expand Down Expand Up @@ -132,7 +131,7 @@ export default function ChartistPluginTooltip<T extends BaseChart<any>>(
let tooltipText = '';

let seriesName = '';
if (chart instanceof Chartist.BarChart) {
if (chart instanceof BarChart) {
seriesName =
(point.parentNode as HTMLElement).getAttribute('ct:meta') ||
(point.parentNode as HTMLElement).getAttribute('ct:series-name') ||
Expand Down