Questions tagged [tspan]

55 questions
0
votes
1 answer

SVG: tspan element x attribute not taking absolute position

X attribute is absolute X coordinate for the tspan element. But we check the output is taking more pixels. Instead of tspan element needs to draw from 30 pixels but it is drawn from 39pixes. Why is it like this? My expectation is that it has to draw…
0
votes
0 answers

Why does tspan position incorrectly over 200px font size?

Inside a text element a tspan allows to style specific parts of text. html, body, svg { width : 100%; height : 100%; margin : 0; background : black; } text { font-size : 100px; fill : white; }
0
votes
1 answer

Align text of svg text element without affecting position

How to align text in an text tag without using the text-anchor attribute? My problem is that using the text-anchor will change the way the x and the y attributes are interpreted, and I don't want that, because I've perfectly set up the position of…
DevelJoe
  • 856
  • 1
  • 10
  • 24
0
votes
1 answer

I would like to modify a with js

I would like to modify the with js but I can't do it. I have no error message. js function taux() { let rue = document.getElementById("input-rue").value; let tauxrue = document.getElementById("tr"); …
Mathis
  • 1
0
votes
1 answer

Is there a way for two SVG inside of line up at the left edge without specifying an absolute x for the child?

The following code will show the "World" as a continuous flow of the x position. We can specify x="200" for that second so that it lines up with the "Hello" at the left edge. But is there a way to do it without needing to specify an absolute…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
0
votes
1 answer

svg won't show text containing g tags

I have reduced my problem to a minimal working example. This code snippet won't show any text:
enanone
  • 923
  • 11
  • 25
0
votes
0 answers

Adding style elements to individual words in a SVG text string

I'm trying to take a d3-generated SVG text element and add styles (bold and colors) to some of the individual words in it. (Edited to add:) A previous function divides the text into a few tspan elements to wrap the text onto multiple lines. I've…
bcwg
  • 15
  • 5
0
votes
2 answers

how to get the style of one character inside

we can get the react and position via SVGTextContentElement.getExtentOfChar(index) but how to get the style of any inside typographic character
Kent Wood
  • 1,392
  • 2
  • 14
  • 30
0
votes
2 answers

How to align set of tspan elements by center?

I googled a lot of ways how to align set of tspan by center, but I need something else. I need to align the set of tspan elements by center and each element should be aligned by the left side with other elements. On the picture below you can see…
Joseph Katzman
  • 1,959
  • 6
  • 21
  • 47
0
votes
1 answer

d3 title tspan text not going to new line

I have d3 title text which contains two tspans. and last tspan has display:block property, but still it is not going to new line. Here is link: https://codepen.io/anon/pen/exJROb JavaScript var ttl = nodeg.append("title"); …
0
votes
3 answers

mark text in g transform css to pulsate

I got a template in SVG data. Here I have a text I would like to pulsate. Html: 50 it´s doesn't work. Here is a link to codepen
B.B
  • 25
  • 7
0
votes
1 answer

highchart center align tspan inside text tag

I want to align the tspan center inside the text tag of highchart. I have created one jsfiddle : here Code Highcharts.chart('container', { chart: { type: 'pyramid' }, title: { text: 'Sales pyramid', x: -50 }, …
Ranjit Singh
  • 3,715
  • 1
  • 21
  • 35
0
votes
0 answers

Aligning SVG grouped tspan in different browsers

To make a webpage responsive I migrated the graphics and divs to a SVG image. The imgae itself runs fine in all browsers now. But I also migrated the dynamically filled text passages to the SVG with and elements. It all works, the…
Blind Seer
  • 492
  • 1
  • 5
  • 17
0
votes
1 answer

Force recalculate svg text size

I'm appending a tspan to a text node but the browser isn't recalculating the new size/box JS code: var result = document.querySelector('#result'); var result_delayed = document.querySelector('#result_delayed'); var text =…
unloco
  • 6,928
  • 2
  • 47
  • 58
0
votes
1 answer

canvg() issue with overlapping tspan

I need to convert an svg element to png. while converting to png the text is getting overlapped and not aligning properly. The actual image is like this: enter image description here The Image after conversion is like this: enter image…
ACHU
  • 11
  • 3