D3.js | d3.values() Function Last Updated : 28 Jun, 2019 Comments Improve Suggest changes Like Article Like Report The d3.values() function in D3.js is used to return an array containing the property values of the specified object or an associative array. Syntax: d3.values(object) Parameters: This function accepts single parameter object which contains the key, value pairs. Return Value: It returns the values of the given object. Below programs illustrate the d3.values() function in D3.js: Example 1: javascript <!DOCTYPE html> <html> <head> <title> d3.values() function </title> <script src = "https://d3js.org/d3.v4.min.js"></script> </head> <body> <script> // Initialising an object var month = { "January": 1, "February": 2, "March": 3, "April": 4 }; // Calling the d3.values() function A = d3.values(month); // Getting the values of the given object document.write(A); </script> </body> </html> Output: 1, 2, 3, 4 Example 2: javascript <!DOCTYPE html> <html> <head> <title> d3.values() function </title> <script src = "https://d3js.org/d3.v4.min.js"></script> </head> <body> <script> // Initialising an object var month = { "GeeksforGeeks": 0, "Geeks": 2, "Geek": 3, "gfg": 4 }; // Calling the d3.values() function A = d3.values(month); // Getting the values of the given object document.write(A); </script> </body> </html> Output: 0, 2, 3, 4 Reference: https://devdocs.io/d3~5/d3-collection#values Comment More infoAdvertise with us Next Article D3.js | d3.values() Function K Kanchan_Ray Follow Improve Article Tags : JavaScript Web Technologies D3.js Similar Reads D3.js | d3.map.values() Function The map.values() function in D3.js used to return an array of values for every entry in the created map. The order of the returned values are arbitrary. Syntax: d3.map.values() Parameters: This function does not accept any parameters. Return Value: This function returns an array of values for every 2 min read D3.js | d3.set.values() Function The set.values() function in D3.js is used to return an array of the string values in the set. This function can be used for computing the unique values for a set of strings. Syntax: d3.set([Array]).values(); Parameters: This function accepts a parameter Array of strings. Return Value: It returns th 2 min read D3.js | d3.keys() Function The d3.keys() function in D3.js is used to return an array containing the property names or keys of the specified object or an associative array. Syntax: d3.keys(object) Parameters: This function accepts single parameter object containing key and value in pairs. Return Value: It returns the keys of 1 min read D3.js | d3.pairs() function The d3.pairs() function in D3.js is used to create pair of array elements from the given array elements. If the given array is having less than two elements then it returns the empty array. Syntax: d3.pairs(Array) Parameters: This function accepts a parameter Array whose elements are going to be pai 2 min read D3.js | d3.sum() function The d3.sum() function in D3.js is used to return the sum of the given array's elements. If the array is empty then it returns 0. Syntax: d3.sum(Array) Parameters: This function accepts a parameters Array which is an array of elements whose sum are to be calculated. Return Value: It returns the sum o 2 min read Like