Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

SVG image size problem

I Try to use the SVG image in Table Function.  But Size of the image is very small. I try used full-size image still show a very small. 

 

Please check Measure

 

Sparkline Line =
// Static line color
VAR LineColor = "#01B8AA"
// "Date" field used in this example along the X axis
VAR XMinDate = MIN('Table'[Date])
VAR XMaxDate = MAX('Table'[Date])
// Obtain overall min and overall max measure values when evaluated for each date
VAR YMinValue = MINX(VALUES('Table'[Date]),CALCULATE([Measure Value]))
VAR YMaxValue = MAXX(VALUES('Table'[Date]),CALCULATE([Measure Value]))
// Build table of X & Y coordinates and fit to 100 x 100 viewbox
VAR SparklineTable = ADDCOLUMNS(
SUMMARIZE('Table','Table'[Date]),
"X",INT(100 * DIVIDE('Table'[Date] - XMinDate, XMaxDate - XMinDate)),
"Y",INT(100 * DIVIDE([Measure Value] - YMinValue,YMaxValue - YMinValue)))
// Concatenate X & Y coordinates to build the sparkline
VAR Lines = CONCATENATEX(SparklineTable,[X] & "," & 100-[Y]," ", [Date])
// Add to SVG, and verify Data Category is set to Image URL for this measure
VAR SVGImageURL = IF(HASONEVALUE('Table'[Category]),
"data:image/svg+xml;utf8," &
"<svg id='_1_green_car' data-name='1_green_car' xmlns='http://www.w3.org/2000/svg' width='4060' height='447.9' viewBox='0 0 4060 447.9'>" &
" <defs>
<style>.cls-1{fill:#575e66;}.cls-2{fill:none;stroke:#fff;stroke-width:6px;stroke-dasharray:48 48;}.cls-3{fill:#98e265;}.cls-11,.cls-12,.cls-3,.cls-4,.cls-5,.cls-6,.cls-7,.cls-8,.cls-9{fill-rule:evenodd;}.cls-10,.cls-4{fill:#80cd65;}.cls-5{fill:#d2edf4;}.cls-6{fill:#6bab54;}.cls-7{fill:#ededee;}.cls-8{fill:#45404e;}.cls-9{fill:#d0cfd2;}.cls-11{fill:#e4e4e5;}.cls-12{fill:#ff5858;}</style></defs><title>1_green_car</title>
<g id='Rectangle_1_copy' data-name='Rectangle 1 copy'><rect class='cls-1' y='285' width='4060' height='162.9'/></g>
<line id='dash' class='cls-2' x1='39.7' y1='366.4' x2='4025' y2='366.4'/><g id='Path'><path class='cls-3' d='M1227.24,129.56a64.21,64.21,0,0,0-16.91-29.81L1129.27,18.8A64.34,64.34,0,0,0,1083.82,0H745.67a80.42,80.42,0,0,0-61,28l-72.36,84.3c-137,0-234.63,23.8-264.9,42.42a50.86,50.86,0,0,0-24.34,43.37v90.71H998L1239,176.5Z'/></g>
<g id='Path-2' data-name='Path'><path class='cls-4' d='M1129.27,18.8A64.3,64.3,0,0,0,1083.82,0H745.67a80.42,80.42,0,0,0-61,28l-72.36,84.3H998l122.5-13.59a400.9,400.9,0,0,1,44.36-2.46h42Z'/></g>
<g id='Path-3' data-name='Path'><path class='cls-5' d='M1117.6,65.08l-29.64-37a32.16,32.16,0,0,0-25.1-12H802.06a32.16,32.16,0,0,0-24.69,11.54L717.63,99.16a8,8,0,0,0,6.18,13.16h252.8A386.1,386.1,0,0,0,1019.2,110l83.63-9.28A22,22,0,0,0,1117.6,65.08Z'/></g>
<g id='Path-4' data-name='Path'><path class='cls-4' d='M1239,160.45a16.05,16.05,0,0,0-16.07-16H596.24c-225,0-273.17,32.09-273.17,64.18v64.18H933.68L1239,240.68Z'/></g>
<g id='Path-5' data-name='Path'><path class='cls-6' d='M1238.62,237.21A16.14,16.14,0,0,0,1219.44,225l-142.89,31.71H323.07a16,16,0,1,0,0,32.09h755.24a16.27,16.27,0,0,0,3.48-.38l144.62-32.1A16,16,0,0,0,1238.62,237.21Z'/></g>
<g id='Path-6' data-name='Path'><path class='cls-7' d='M1102.41,191.2a73.55,73.55,0,1,0,73.65,73.55A73.6,73.6,0,0,0,1102.41,191.2Z'/></g>
<g id='Composite_Path' data-name='Composite Path'><path class='cls-8' d='M1102.41,176.5a88.25,88.25,0,1,0,88.38,88.25A88.41,88.41,0,0,0,1102.41,176.5Zm0,144.41a56.16,56.16,0,1,1,56.24-56.16A56.26,56.26,0,0,1,1102.41,320.91Z'/></g>
<g id='Path-7' data-name='Path'><path class='cls-9' d='M1102.41,232.66a32.09,32.09,0,1,0,32.14,32.09A32.11,32.11,0,0,0,1102.41,232.66Z'/></g>
<g id='Path-8' data-name='Path'><path class='cls-6' d='M981.9,192.55H596.25a16,16,0,1,0,0,32.09H981.9a16,16,0,1,0,0-32.09Z'/></g>
<g id='Path-9' data-name='Path'><path class='cls-6' d='M339.14,192.55H323.07a16,16,0,1,0,0,32.09h16.07a16,16,0,1,0,0-32.09Z'/></g>
<g id='Path-10' data-name='Path'><rect class='cls-10' x='863.35' y='16.04' width='32.14' height='96.27'/></g><g id='Path-11' data-name='Path'><path class='cls-11' d='M355.21,160.45H340.32a50.23,50.23,0,0,0-16.53,32.1h31.42a16.05,16.05,0,1,0,0-32.1Z'/></g>
<g id='Path-12' data-name='Path'><path class='cls-5' d='M743.71,16.05H717.48a80.45,80.45,0,0,0-12.81,12l-72.36,84.3h33.15a32.15,32.15,0,0,0,24.69-11.55l59.73-71.56A8,8,0,0,0,743.71,16.05Z'/></g>
<g id='Path-13' data-name='Path'><polygon class='cls-4' points='1030.11 16.05 997.97 16.05 1028.96 108.88 1074.08 103.87 1030.11 16.05'/></g>
<g id='Path-14' data-name='Path'><path class='cls-12' d='M1227.24,129.56a64.08,64.08,0,0,0-7.21-17.24h-29.24a16,16,0,1,0,0,32.09H1231Z'/></g>
<g id='Path-15' data-name='Path'><path class='cls-7' d='M475.73,191.2a73.55,73.55,0,1,0,73.65,73.55A73.6,73.6,0,0,0,475.73,191.2Z'/></g>
<g id='Composite_Path-2' data-name='Composite Path'><path class='cls-8' d='M475.73,176.5a88.25,88.25,0,1,0,88.38,88.25A88.42,88.42,0,0,0,475.73,176.5Zm0,144.41A56.16,56.16,0,1,1,532,264.75,56.26,56.26,0,0,1,475.73,320.91Z'/></g>
<g id='Path-16' data-name='Path'><path class='cls-9' d='M475.73,232.66a32.09,32.09,0,1,0,32.14,32.09A32.11,32.11,0,0,0,475.73,232.66Z'/></g>
</svg>",
BLANK())
RETURN SVGImageURL

 

Also, I try you use the responsive image SVG code still problem is same:


<svg id='_1_green_car' data-name='1_green_car' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4060 447.9'>" &
" <defs>
<style>
.cls-1 {
fill: #575e66;
}
.cls-2 {
fill: none;
stroke: #fff;
stroke-width: 6px;
stroke-dasharray: 48 48;
}

.cls-3 {
fill: #98e265;
}
.cls-11, .cls-12, .cls-3, .cls-4, .cls-5, .cls-6, .cls-7, .cls-8, .cls-9 {
fill-rule: evenodd;
}
.cls-10, .cls-4 {
fill: #80cd65;
}
.cls-5 {
fill: #d2edf4;
}
.cls-6 {
fill: #6bab54;
}
.cls-7 {
fill: #ededee;
}
.cls-8 {
fill: #45404e;
}

.cls-9 {
fill: #d0cfd2;
}

.cls-11 {
fill: #e4e4e5;
}

.cls-12 {
fill: #ff5858;
}
</style>
</defs>
<g id='Rectangle_1_copy' data-name='Rectangle 1 copy'>
<rect class='cls-1' y='285' width='4060' height='162.9'/>
</g>
<line id='dash' class='cls-2' x1='39.7' y1='366.4' x2='4025' y2='366.4'/>

<g id='Path'>
<path class='cls-3' d='M1227.24,129.56a64.21,64.21,0,0,0-16.91-29.81L1129.27,18.8A64.34,64.34,0,0,0,1083.82,0H745.67a80.42,80.42,0,0,0-61,28l-72.36,84.3c-137,0-234.63,23.8-264.9,42.42a50.86,50.86,0,0,0-24.34,43.37v90.71H998L1239,176.5Z'/>
</g>
<g id='Path-2' data-name='Path'>
<path class='cls-4' d='M1129.27,18.8A64.3,64.3,0,0,0,1083.82,0H745.67a80.42,80.42,0,0,0-61,28l-72.36,84.3H998l122.5-13.59a400.9,400.9,0,0,1,44.36-2.46h42Z'/>
</g>

<g id='Path-3' data-name='Path'>
<path class='cls-5' d='M1117.6,65.08l-29.64-37a32.16,32.16,0,0,0-25.1-12H802.06a32.16,32.16,0,0,0-24.69,11.54L717.63,99.16a8,8,0,0,0,6.18,13.16h252.8A386.1,386.1,0,0,0,1019.2,110l83.63-9.28A22,22,0,0,0,1117.6,65.08Z'/>
</g>

Also, I add the Power BI Where I try to use this image. Please look.

 

Please help how I fix this:

https://drive.google.com/file/d/1Prxmb1O8ycxysuKAUmN4o6ukYI_oW_Nx/view?usp=sharing

 

1 REPLY 1
deldersveld
Resident Rockstar
Resident Rockstar

The Table allows a square image size from 24px x 24px up to 150px x 150px. Your SVG has a width that is 10x the height. You can manipulate the width and viewBox in the SVG to try work around your extremely wide original image to focus on the car.


Example: see how things "zoom in" on the car when you use width='447.9' height='447.9' viewBox='0 0 1400 447.9'

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors