D3.js Shapes Stacks API Complete Reference Last Updated : 06 Nov, 2023 Improve Improve Like Article Like Save Share Report The D3 is an abbreviation of Data-Driven Documents, and D3.js is a resource JavaScript library for managing documents based on data. D3 is one of the most effective frameworks to work on data visualization. Shapes Stacks: Description D3.js stack() Function The d3.stack() method constructs a new stack generator with the default settings. This stack generator can be further used to create stacks. D3.js stack.keys() Function The stack.keys() method makes an array of strings as an argument and returns the stack generator. D3.js stack.value() Function The stack.value() method takes a function that returns the value associated with a key. D3.js stack.order() Function The stack.order() method takes an ordering function as an argument and returns the stack generator. D3.js stack.offset() Function In D3.js, the stack.offset() function is used to define the method of stacking data in a stack chart (such as a stacked bar chart or subplot). D3.js stackOrderAppearance() Function The d3.stackOrderAppearance() method orders the series such that the series having the earliest maximum value (i.e. series with its maximum value at the lowest index) is positioned at the bottom of the stack, and the series that has the latest maximum is placed on the top. D3.js stackOrderAscending() Function The d3.stackOrderAscending() method orders the series based on the ordering of the keys as defined by the stack.keys() method. The series with the smallest sum with be placed on the bottom, ascending upwards to the largest. D3.js stackOrderDescending() Function The d3.stackOrderDescending() method orders the series based on the ordering of the keys as defined by the stack.keys() method. The series with the largest sum with be placed on the bottom, ascending upwards to the smallest. D3.js stackOrderInsideOut() Function The D3.js stackOrderInsideOut() method returns a series order such that the larger series (according to the sum of values) are on the inside and the smaller series are on the outside D3.js stackOrderNone() Function The d3.stackOrderNone() method orders the series based on the ordering of the keys as defined by stack.keys() method. D3.js stackOrderReverse() Function The d3.stackOrderReverse() method orders the series based on the ordering of the keys as defined by stack.keys() method. D3.js stackOffsetExpand() Function The D3.js stackOrderOffsetExpand() method applies a zero baseline and normalizes the values for each point such that the topline is always one. Like Article Suggest improvement Next D3.js Shapes Symbols API Complete Reference Share your thoughts in the comments Add Your Comment Please Login to comment...