score:0
you could use a filter like this:
polygonlastdelivery.append("path")
.filter(function(d) { return d.status !== "" })
.attr("class", "point")
.attr("d", d3.svg.symbol().type("cross"))
.attr("transform", function(d) { return "translate(" + 15 + "," + 22 + ")"; });
or you could use each if you want to change your symbol based on status:
polygonlastdelivery.each(function(d){
var object = d3.select(this);
var symbol = (d.status !== "") ? 'cross': 'diamond';
object.append("path")
.attr("class", "point")
.attr("d", d3.svg.symbol().type(symbol))
.attr("transform", function(d) { return "translate(" + 15 + "," + 22 + ")"; });
});
Source: stackoverflow.com
Related Query
- How to add a symbol to a group depending on its data
- How can I add a duration histogram's time data to its bars?
- How can I add a variable number of nodes with D3 append() function depending on data
- How to create elements depending on data in D3?
- D3 force layout: How to index data by its ID instead of its index in "nodes" array
- d3 monthly data set - update data- add new group
- how can i group JSON data into the weeks according to calender?
- d3.js: How to add a data key?
- Is there a way to add different shapes depending on different data to my force-directed graph?
- How can I add an external group to an existing svg with d3.js?
- How to add labels to D3 Chord diagram Group Arcs on arc.centroid()?
- In D3js, how do I cumulative add on every nth bound data value?
- How to add data to selectAll placeholder whose data is in a parent's parent object?
- d3 v4 how to add data labels to bar graph
- How to add the data in the tooltip after the dataset switching
- How to add live data to stacked bar chart
- How to represent each data entry with a pie chart of its values?
- How do you add multiple lines to a D3JS line chart where the depedent variable data sources start at different positions along the range?
- How can I group data to be filtered without losing crossfilter functionality using dc.js?
- How to add a second tooltip, with data, from a data driven d3 chart
- How to append different shapes including images depending on data in D3.js?
- How to add data labels to dimple.js bar charts?
- how to add multiple x axes to d3 chart via data join?
- How can i group elements that are bound to different data (to be used with forcesimulatoin) in D3 so that I can sort them
- How to add specific colors to data in JSON with d3.js
- How to add location specific data to markers on a map
- How do I add my own data to a responsive US states map?
- how can i group JSON data and generate a graph of each group in D3js
- How can I add a delay between function calls that change data in d3.js?
- how to add new elements to d3 data set used in enter.append?
More Query from same tag
- using d3.queue to wait for AJAX response
- Error in mounted hook: "TypeError: edge is undefined" when using dagre-d3 with vue2
- jquery .ready() equivalent in d3js?
- Inhibit mouse interactions for certain svg child elements
- d3.js passing in multiple functions on hover
- Raster reprojection with D3
- Sum of nested JSON array using D3 .rollup
- Load csv file in d3.js using absolute path
- How can i make count to be displayed permanently at the end of graph bars?
- Getting key and value of object
- Ticks should correspond to Date data points in D3.js
- Formatting dates as financial year in DC.js
- nvd3.js will not take data from jquery
- How to add custom tick labels in d3.js?
- How to import a package and call the function in angular?
- D3Js updating wrong elements using call
- Configure SystemJS to always return same instance of library
- d3 force directed graph, focus on node double click
- D3 js with angular 2 popup on clicking the arc of pie
- Set bars sizes according to data percents
- d3 (or JavaScript): use local variable in another function
- array of rectangles without d3.js
- d3js negative and positive barplot looses its alignment when more bars added
- Working with dynamic JSON in d3.js
- d3 I can't add nodes
- d3.js Odd Rotation Behavior
- How to adjust path links in TreeView D3.js
- D3 (with angular) Failing to insert a span inside a div
- d3-tip doesn't work with webpack
- Unable to append images over nodes in d3.js