Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

svg marker

<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <!-- simple dot marker definition -->
    <marker id="dot" viewBox="0 0 10 10" refX="5" refY="5"
        markerWidth="5" markerHeight="5">
      <circle cx="5" cy="5" r="5" fill="red"/>
    </marker>
  </defs>

  <!-- Data line with polymarkers -->
  <polyline points="15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="grey"
   marker-start="url(#dot)" marker-mid="url(#dot)"  marker-end="url(#dot)"/>
  <!--
    Marker attributes:
	markerHeight - the height of the marker viewport, default value: 3
	markerWidth - the width of the marker viewport, default value: 3
	markerUnits - the coordinate system for the marker content and the attributes markerWidth and markerHeight
				  possible values: userSpaceOnUse or strokeWidth,
				  default value: strokeWidth
	orient - the orientation of the marker relative to the shape it is attached to
			 possible values: auto, auto-start-reverse, or <angle>;
			 default value: 0
	preserveAspectRatio - defines how the svg fragment must be deformed if it is embedded in a container with a different aspect ratio,
			              value format: "(none|xMinYMin|xMidYMin|xMaxYMin|xMinYMid|xMidYMid|xMaxYMid|xMinYMax|xMidYMax|xMaxYMax) (meet|slice)?",
						  default value: xMidYMid meet
	refX - the x coordinate for the reference point of the marker,
		   possible values: left, center, right, or <coordinate>;
		   default value: 0
	refY - the y coordinate for the reference point of the marker,
		   possible values: top, center, bottom, or <coordinate>;
		   default value: 0
	viewBox - defines the bound of the SVG viewport for the current SVG fragment,
			  default value: none
  -->
</svg>
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #svg #marker
ADD COMMENT
Topic
Name
1+9 =