score:1
Accepted answer
you need to make 2 changes
1 - Assign the dots class to the parent g element, so the i variable is only iterated per group of dots. Don't use assign class on the dots themselves.
var pointsGroup = g.selectAll(null)
.data(data)
.enter()
.append("g")
.attr("class", function(d, i) {
return "dots" + i
})
.attr("fill", function(d, i) {
local.set(this, yScale[i])
return colors[i];
});
2 - Select the dots class by including "." in the selection name
d3.selectAll(".dots" + i).style("opacity", newOpacity);
Source: stackoverflow.com
Related Query
- How to toggle data points on and off along with lines in multi-line chart
- Incomplete line chart with missing points and missing lines
- How do you get JSON data and create a line chart with d3.js?
- How do you add multiple lines to a D3JS line chart where the depedent variable data sources start at different positions along the range?
- D3.JS how to load 3 csv files and change data on line chart with button click event?
- D3 V4 Multi series line chart: Adding data points to lines with same color as lines
- How to render multi line chart with DC.js with the following type of data - JAVASCRIPT (DC.js)
- how to zoom d3.js chart and reload data with greater granularity (in AJAX)
- Align lines and dots with x-axis values in line chart
- How to plot data points on multi-line chart with multiple y axes
- How to make a mouseover interactive line graph with multiple data series and 2 y axes?
- D3 line chart does not show tool tip and data points properly
- How can you draw a collection of lines and points based on categorical data in D3?
- How to toggle lines in a line chart using a legend
- Add data points and text to lines on a multi-bar graph with lines
- How to normalize data in d3 and plot the lines in the axis independent of other line ranges
- Time in x-axis and data for the y-axis for line chart in d3.js doesn't match/show with what (data) is on JSON
- Iterative/chained transitions along line graph with discrete points and delay
- How to draw a multi line series graph using d3.js with json data using angular directives
- Line chart - how to display data points whilst line path is being drawn
- How to create a line chart with vertical line and different backgrounds?
- Using D3, I am trying to add and remove lines from a multi line chart when the legend is clicked
- How to put data on line chart when x axis and data has a time range
- How to synchronize scatter points and line chart during an update to the data?
- D3 line chart and adding data points real time
- how to make real time multi line chart using d3 where data is from api in json format
- Change format and data of datetime X-axis in a line chart with d3 Javascript library
- How to implement tooltip for D3 line chart with data from 2 arrays?
- d3js - How to update an existing svg path in a simple d3 line chart with new data flowing through?
- d3 multi line chart with zoom and update
More Query from same tag
- Angular2 xlink:href url() issue
- How can I make the legend's similar to the stacked bar chart (and change the legend's label) in D3 v6?
- Comparing and converting multiple arrays
- make a tabpanel-like with SVG elements
- D3 - Grid when the axis is in the middle of the page
- how to stack series in nvd3 multibar angularjs directive
- Creating a manual link between 2 selected nodes in D3
- c3.js how to get a onclick event for DataGroups
- converting json format to work with d3
- Understanding and rebuilding overload of a dataframe to d3 format
- Dynamic charts with d3 giving problems with duplicate elements in array
- d3 center tick and x-axis label when single value
- How to make Nvd3 use log scale on y-axis
- AngularJS DOM modification deletes events -> need viable workaround implementation schema
- How do I change the properties of the x-axis and y-axis of the graph and also the text-anchor of the axis?
- How to show/hide on geo map?
- What is d3.geo.pipeline?
- Create a symbol generator with D3.js
- nvd3 multibarchart height and label issue
- How to drag nodes with children in d3 circle packing?
- D3 - why is this sort function not updating all the elements in its selection?
- d3 update old scale when pan and zoom
- d3.js loading csv files with ISO-8859-1 encoding
- Select specific number of items from a list
- Do I add eventListener to every SVG element if I follow normal D3 way?
- D3 Paths from external data not appearing
- d3.js Line Graph Axises won't go to highest number
- R Specify colors in sankeyNetwork
- D3: How to dynamically refresh a graph by changing the data file source?
- D3 click event with multiple svg on one page