Forum Discussion
az2451
8 years agoResolver I
How to draw a linear line by using a given slope
Hello there, i have an urgent problem here that i cant solve... I'm trying to draw a linear line in a scatter plot to visualize a given slope-value. First of all, this is how i calculate m...
- 8 years ago
The width and height are not supported by a line element.
It seems you should apply a color to this line.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- 8 years ago
Thanks this worked for me:
let sLine = this.g .append('g') .append('line') .classed('sLine', true) .attr('x1', x(0)) .attr('y1', y(0)) .attr('x2', x(viewModel.dataMax * this.slopeVal[0])) .attr('y2', y(viewModel.dataMax)) .attr('stroke', 'red');
az2451
8 years agoResolver I
I tried that but i think line is not supported because nothing shows up at all
let sLine = this.g
.append('g')
.append('line') // rect and circle works, but line doesnt however
.classed('sLine', true)
.attr('x1', x(0))
.attr('y1', y(5))
.attr('x2', x(10))
.attr('y2', y(20))
.attr('width', 2)
.attr('height', 500);v-viig
8 years agoCommunity Champion
The width and height are not supported by a line element.
It seems you should apply a color to this line.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- az24518 years agoResolver I
Thanks this worked for me:
let sLine = this.g .append('g') .append('line') .classed('sLine', true) .attr('x1', x(0)) .attr('y1', y(0)) .attr('x2', x(viewModel.dataMax * this.slopeVal[0])) .attr('y2', y(viewModel.dataMax)) .attr('stroke', 'red');