score:1
You can initially create all data labels, but hide them by setting opacity style to 0. Then, use mouseOver
and mouseOut
events to toggle the opacity.
const toggleDLInLinks = (links, isVisible) => {
links.forEach(link => {
if (isVisible) {
link.toNode.dataLabel.css({
opacity: 1
})
} else {
link.toNode.dataLabel.css({
opacity: 0
})
}
if (link.toNode.linksFrom.length) {
toggleDLInLinks(link.toNode.linksFrom, isVisible);
}
});
};
Highcharts.chart('container', {
plotOptions: {
networkgraph: {
...,
dataLabels: {
allowOverlap: true,
enabled: true,
style: {
opacity: 0,
transition: ''
}
},
point: {
events: {
mouseOver: function() {
const point = this;
if (point.linksFrom.length) {
toggleDLInLinks(point.linksFrom, true);
}
},
mouseOut: function() {
const point = this;
if (point.linksFrom.length) {
toggleDLInLinks(point.linksFrom);
}
}
}
},
keys: ['from', 'to']
}
},
...
});
Live demo: https://jsfiddle.net/5n2u1b3L/
API Reference: https://api.highcharts.com/class-reference/Highcharts.SVGElement#css
score:0
You have provided no code I can only explain what could be done.
We can for example, we listen when user mouseOver
's our series and we then turn dataLabels enabled
for that series and it's children. Everything else get dataLabels disabled
series: {
stickyTracking: true,
events: {
mouseOver: function () {
var hoverSeries = this;
this.chart.series.forEach(function(s){
if(s != hoverSeries) {
// Turn off other series labels
s.update({
dataLabels: {
enabled: false
}
});
} else {
// Turn on hover series labels
hoverSeries.update({
dataLabels: {
enabled: true
}
});
}
});
},
mouseOut: function () {
this.chart.series.forEach(function(s){
// Reset all series
s.setState('');
s.update({
dataLabels: {
enabled: true
}
});
});
}
}
}
Some example: https://jsfiddle.net/fakytqhd/
Source: stackoverflow.com
Related Query
- Highcharts networkgraph datalabels on hover
- highcharts dataLabels support RTL with enable hover it for show tooltip
- Disable hover on HighCharts
- How to Format Highcharts dataLabels Decimal Points
- Highcharts - manually trigger hover event on a point
- highcharts - disable fading series on marker hover
- Is it possible to position Highcharts dataLabels depending on the value?
- Highcharts - HTML tooltip & datalabels render issue
- Highcharts pie dataLabels inside and outside
- Highcharts + Plotband tooltip hover + default styling
- how to make highcharts pie datalabels always in center of each slice?
- Stop HighCharts increasing width of line on hover
- Highcharts Change column color on hover
- Highcharts separate datalabels per series
- Highcharts Donut Chart text in center change on hover
- Highcharts legend item hover event?
- DataLabels formatter not working in Highcharts Sankey Diagram
- Can I with highcharts column stacking on hover not highlighting the whole serie
- Fix Highcharts dataLabels to the bottom
- Stop HighCharts change transparency of another series on hover of one series
- Color contrast setting on dataLabels style parameter using Highcharts 5 is not working on some colors
- Rotating dataLabels in a Highcharts pie chart
- Highcharts Areaspline - Highlight a column on hover effect
- Color individual markers on hover in Highcharts
- Highcharts bubble chart dataLabels overlapping
- Highcharts hover bug - with video to demonstrate
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts - Global configuration with common code and unique data & Headings
- Highcharts exporting.js change menu hover title text
- highcharts / highstock column doesn't show all datalabels
More Query from same tag
- Generate Highcharts from CSV generated by php
- Highcharts / highstock how to change title of chart in IE?
- Highcharts: allowDecimals on y-axis when it's logarithmic is ignored
- Exporting highcharts data to CSV file
- Highcharts chartWidth no longer works with chart.getSVG()
- Highcharts, type: 'mapbubble' causes an error 17
- How to make click on area above / below small column, in unstacked column chart, fire the point click event
- Highchart tooltip hover not working properly
- How to tell Highcharts to set date on the x axis, and use a range of time (like 1 day)
- how to display data labels / stacklabels for a grouped highhcarts- Highcharts
- Highstock bottom chart not shown
- Getting average or number of columns Highstock
- Highchart Spider web chart, pointPlacement and tickInterval
- How to make highchart bubble chart color active of clicked bubble
- Highcharts - Ignore Series in Pie Percentage
- Hide axis and gridlines Highcharts
- Using Highcharts.js with odoo
- Drop down integration with bubble chart
- Is there way to skip empty value ticks?
- MySQL, Highcharts: “operand should contain 1 column(s):” error (follow up)
- Showing multiple plot lines while displaying dual y-axis
- How can I show last 10 indexes in Highcharts Timeline and left using scroll?
- Onclick of a org chart another org chart will open as a modal popup
- why my highchart code is not working?
- Highcharts - Passing in Color with JSON
- Adding round corners to Highcharts Bar Chart with stacked bars when value is 0
- Adding comma format to Highcharter tooltips
- Add tag "series:" into Highcharts, from the response server JSON
- Scroll bar in Highcharts tooltip
- How to aggregate boolean values in elastic search?