Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show correctly hovered width of dataseries which can be configur… #74

Merged
merged 1 commit into from
Nov 13, 2023
Merged
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: 2 additions & 5 deletions src/chart/drawers/data-series.drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ export class DataSeriesDrawer implements DynamicModelDrawer<DataSeriesModel> {
const paintTool = series.config.type;
const drawer = this.seriesDrawers[paintTool];
if (drawer) {
const viewportSeries = series.getSeriesInViewport(
series.scale.xStart - 1,
series.scale.xEnd + 1,
);
const viewportSeries = series.getSeriesInViewport(series.scale.xStart - 1, series.scale.xEnd + 1);
if (viewportSeries && viewportSeries.length >= 1) {
// +- 1 to correctly draw points which are partly inside bounds
drawer.draw(ctx, viewportSeries, series, {});
Expand Down Expand Up @@ -89,7 +86,7 @@ export const setLineWidth = (
if (drawerConfig.forceBold) {
ctx.lineWidth = drawerConfig.forceBold;
} else if (dataSeries.hovered) {
ctx.lineWidth = seriesSelectedWidth;
ctx.lineWidth = lineWidth !== seriesSelectedWidth ? lineWidth + 1 : seriesSelectedWidth;
} else {
ctx.lineWidth = lineWidth;
}
Expand Down