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

Disabling hover via onover/onout breaks other legend behavior #1598

Closed
kmatarese opened this issue Aug 12, 2020 · 1 comment
Closed

Disabling hover via onover/onout breaks other legend behavior #1598

kmatarese opened this issue Aug 12, 2020 · 1 comment
Labels

Comments

@kmatarese
Copy link

Description

I was trying to disable legend hover behavior for charts that have a lot of data/series since it can slow down the UI and/or become a little less useful. It seems to break some of the legend behavior, at least with the approach I took. Perhaps a simple flag to do this would be useful. Thanks.

Steps to check or reproduce

Using Firefox 79.0 on OS X 10.14.

https://r4ytef.run.stackblitz.io

import "billboard.js/dist/theme/insight.css";
import bb from "billboard.js";

bb.generate({
	data: {
		columns: [
			["data1", 500, 350, 300, 0, 0, 0],
			["data2", 230, 100, 140, 200, 150, 50]
		]
	},
  legend: {
    show: true,
    // Disabling hover breaks other logic it seems. For example if you
    // click to remove a series it remains highlighted in the legend. Maybe
    // there is a better way to do it.
    item: {
      onover: (x) => {},
      onout: (x) => {}
    }
  },
});
@netil
Copy link
Member

netil commented Aug 14, 2020

One of the alternative is removing event bound for legend elements.

const chart = bb.generate({
	data: { ... },
	onafterinit: function() {
                // will remove 'mouseover & mouseout' event listeners
		this.$.legend.selectAll("g").on("mouseover mouseout", null);
	}
});

@netil netil closed this as completed May 12, 2021
netil pushed a commit to netil/billboard.js that referenced this issue Jun 22, 2023
This option can control default interaction of legend items

Ref naver#1598
netil added a commit that referenced this issue Jun 22, 2023
This option can control default interaction of legend items

Close #1598
github-actions bot pushed a commit that referenced this issue Jul 3, 2023
# [3.9.0](3.8.2...3.9.0) (2023-07-03)

### Bug Fixes

* **export:** Fix Plugin class import ([24c0976](24c0976)), closes [#3221](#3221)
* **shape:** Fix shape rendering issue on Windows ([cf1b484](cf1b484)), closes [#3222](#3222)
* **tooltip:** Fix tooltip overflow when right side edge is hovered ([9ce900d](9ce900d)), closes [#3254](#3254)

### Features

* **arc:** Intent to ship arc.needle ([04e90aa](04e90aa)), closes [#3205](#3205)
* **bar:** Intent to ship bar.front ([f7e0d80](f7e0d80)), closes [#2965](#2965)
* **data:** Intent to ship data.labels.position function ([59be3ec](59be3ec)), closes [#3237](#3237)
* **legend:** Intent to ship legend.item.interaction.dblclick ([18f5c4a](18f5c4a)), closes [#1404](#1404)
* **legend:** Intent to ship legent.item.interaction ([af87d10](af87d10)), closes [#1598](#1598)
* **point:** Enhance point.sensitivity ([a537201](a537201)), closes [#2568](#2568)
* **theme:** Intent to ship dark theme ([252a28e](252a28e)), closes [#3229](#3229)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants