D3.js selection type

0

I'm developing a script using the D3 lib to draw a graphic, but I wanted to make a method for coloring the "Axis" of my chart and for that I need to pass the selection to a method, just like the color I want "paint" only I am not able to use the methods of the variable that I am passing because the Typescript gives a "Can not read property 'selectAll" error: I would like to know what exactly the type of variable that d3 guava its elements

var xAxisGroup = svg.append('g')
this.colorAxis(xAxisGroup, this.textColor);

  private colorAxis(axisSelection: d3.ContainerElement, desiredColor: portal.Color): void{
<d3.SelectionFn>axisSelection.selectAll("line")
  .style('stroke', this.textColor.code);
<d3.SelectionFn>axisSelection.selectAll('path')
  .style('stroke', this.textColor.code);
<d3.SelectionFn>axisSelection.selectAll('text')
  .style('stroke', this.textColor.code);
}

    
asked by anonymous 11.12.2018 / 18:37

0 answers