Spurious triangles in Pie Chart's SVG Export

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
IanK
Newbie
Newbie
Posts: 5
Joined: Mon Sep 04, 2017 12:00 am

Spurious triangles in Pie Chart's SVG Export

Post by IanK » Wed Jan 10, 2018 2:19 pm

If you export a pie chart to a SVG file, as well as all the expected content it seems to include a set of random triangles too - sample available on request, as the forums don't allow them to be attached to posts.

To reproduce, just add a TChart to a new form, give this a pie chart series (with the initial set of random values), and do the export with a line of this form:

Code: Select all

VclTee.TeeSVGCanvas.TeeSaveToSVGFile(Chart1, 'C:\Test.svg', 500, 500) ;
Is a fix available for this?

As an aside, the call appears to ignore any values given to the optional third and forth parameters (which are width and height from their names). I haven't been able to find any documentation for this function, so it's not 100% clear how they're meant to be used - could you clarify, please?

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Spurious triangles in Pie Chart's SVG Export

Post by Yeray » Thu Jan 11, 2018 12:10 pm

Hello,
IanK wrote:If you export a pie chart to a SVG file, as well as all the expected content it seems to include a set of random triangles too - sample available on request, as the forums don't allow them to be attached to posts.
I've reproduced the problem in 2D (it works fine in 3D) so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1965
IanK wrote:As an aside, the call appears to ignore any values given to the optional third and forth parameters (which are width and height from their names). I haven't been able to find any documentation for this function, so it's not 100% clear how they're meant to be used - could you clarify, please?
I've seen this problem seems to appear since we implemented the fix for #734. We are revising it and we'll be back to you asap.

Thanks for reporting both problems.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Spurious triangles in Pie Chart's SVG Export

Post by Yeray » Thu Jan 11, 2018 3:11 pm

Yeray wrote:
IanK wrote:As an aside, the call appears to ignore any values given to the optional third and forth parameters (which are width and height from their names). I haven't been able to find any documentation for this function, so it's not 100% clear how they're meant to be used - could you clarify, please?
I've seen this problem seems to appear since we implemented the fix for #734. We are revising it and we'll be back to you asap.
Fixed for the next maintenance release.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

IanK
Newbie
Newbie
Posts: 5
Joined: Mon Sep 04, 2017 12:00 am

Re: Spurious triangles in Pie Chart's SVG Export

Post by IanK » Thu Jan 11, 2018 3:54 pm

Thanks for the update Yeray, and for addressing the export size problem so promptly.

Regarding the triangles, the export I'm getting them on is a 3D one; I've had another go at attaching a sample file, this time with the extension changed to ".txt" (and then ".dat") to try to get past any blocked types, but in both cases they were disallowed too. Is there a safe extension I could use, or another way of getting the file to you?

Regards,
Ian
Yeray wrote:Hello,
IanK wrote:If you export a pie chart to a SVG file, as well as all the expected content it seems to include a set of random triangles too - sample available on request, as the forums don't allow them to be attached to posts.
I've reproduced the problem in 2D (it works fine in 3D) so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1965
IanK wrote:As an aside, the call appears to ignore any values given to the optional third and forth parameters (which are width and height from their names). I haven't been able to find any documentation for this function, so it's not 100% clear how they're meant to be used - could you clarify, please?
I've seen this problem seems to appear since we implemented the fix for #734. We are revising it and we'll be back to you asap.

Thanks for reporting both problems.

IanK
Newbie
Newbie
Posts: 5
Joined: Mon Sep 04, 2017 12:00 am

Re: Spurious triangles in Pie Chart's SVG Export

Post by IanK » Thu Jan 11, 2018 4:05 pm

A further update on this; given that the .svg file is XML, and that's essentially text, I thought I'd get get sample through to you by posting it in the message body. Please see below.

Also, after some tentative poking around it turns out that the run of lines of the form:

Code: Select all

<polygon fill="rgb(160,160,160)" fill-opacity="0.5" stroke="none" ... />
are responsible for the triangles I reported; delete these and you get a clean chart (and that's something I can do in code, as a stopgap).

Hope this is of use!

.svg file contents follow:

Code: Select all

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" baseProfile="full"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="441px" height="253px">
<rect  x="0" y="0"  width="440" height="252" fill="rgb(240,240,240)" fill-opacity="1"/>
<rect  x="0" y="0"  width="441" height="253" fill="rgb(240,240,240)" fill-opacity="1" stroke="none"/>
<polyline fill="none"  stroke="white" stroke-opacity="1"
points="0,252 0,0 440,0 "/>
<polyline fill="none"  stroke="rgb(160,160,160)" stroke-opacity="1"
points="440,0 440,252 -1,252 "/>
<text x="118" y="22" font-family="Verdana" font-size="8pt"  fill="blue" fill-opacity="1">
Sample&#32;Chart
</text>
<polygon fill="rgb(160,160,160)" fill-opacity="0.5" stroke="none"
 points="160,147 91,103 229,192 298,148 223,68"/>
<polygon fill="rgb(160,160,160)" fill-opacity="0.5" stroke="none"
 points="154,130 85,86 223,175 217,51 30,92"/>
<polygon fill="rgb(160,160,160)" fill-opacity="0.5" stroke="none"
 points="160,147 91,103 229,192 36,109 50,202"/>
<polygon fill="rgb(160,160,160)" fill-opacity="0.5" stroke="none"
 points="160,147 91,103 229,192 50,202 119,232"/>
<polygon fill="rgb(160,160,160)" fill-opacity="0.5" stroke="none"
 points="160,147 91,103 229,192 119,232 142,236"/>
<polygon fill="rgb(160,160,160)" fill-opacity="0.5" stroke="none"
 points="160,147 91,103 229,192 142,236 152,236"/>
<polygon fill="rgb(160,160,160)" fill-opacity="0.5" stroke="none"
 points="160,147 91,103 229,192 152,236 266,204"/>
<polygon fill="rgb(160,160,160)" fill-opacity="0.5" stroke="none"
 points="160,147 91,103 229,192 266,204 298,148"/>
<polygon fill="rgb(211,124,21)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="151,119 181,82 181,88 151,126 "/>
<polygon fill="rgb(211,124,21)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="151,119 91,101 91,107 151,126 "/>
<polygon fill="rgb(243,156,53)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="151,119 181,82 180,81 179,81 178,81 177,80 176,80 175,80 174,80 173,79 172,79 171,79 169,79 168,78 167,78 166,78 165,78 164,78 163,78 161,78 160,77 159,77 158,77 157,77 156,77 155,77 153,77 152,77 151,77 150,77 149,77 147,77 146,77 145,77 144,77 143,77 142,77 141,78 139,78 138,78 137,78 136,78 135,78 134,78 133,79 131,79 130,79 129,79 128,80 127,80 126,80 125,80 124,81 123,81 122,81 121,82 120,82 119,82 118,83 116,83 115,83 115,84 114,84 113,85 112,85 111,86 110,86 109,86 108,87 107,87 106,88 105,88 104,89 104,89 103,90 102,91 101,91 100,92 100,92 99,93 98,93 97,94 97,95 96,95 95,96 95,96 94,97 94,98 93,98 92,99 92,100 91,100 91,101 151,119 "/>
<polygon fill="rgb(36,70,131)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 187,94 187,100 157,138 "/>
<polygon fill="rgb(36,70,131)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 224,131 224,138 157,138 "/>
<polygon fill="rgb(68,102,163)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 224,131 224,131 224,130 224,129 224,129 224,128 224,127 224,126 223,126 223,125 223,124 223,123 223,123 222,122 222,121 222,120 221,120 221,119 221,118 220,118 220,117 220,116 219,116 219,115 218,114 218,114 217,113 217,112 216,112 216,111 215,110 214,110 214,109 213,108 213,108 212,107 211,107 211,106 210,105 209,105 208,104 208,104 207,103 206,103 205,102 204,101 204,101 203,100 202,100 201,99 200,99 199,98 198,98 197,98 196,97 195,97 194,96 193,96 193,95 192,95 190,95 189,94 188,94 187,94 157,131 "/>
<polygon fill="rgb(209,44,0)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 97,113 97,119 157,138 "/>
<polygon fill="rgb(209,44,0)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="90,138 90,139 90,139 90,140 90,141 90,142 90,142 90,143 91,144 91,144 91,145 91,146 91,147 92,147 92,148 92,149 93,150 93,150 93,151 94,152 94,152 94,153 95,154 95,154 96,155 96,156 97,156 97,157 98,158 98,158 99,159 100,160 100,160 101,161 101,162 102,162 103,163 103,163 103,157 103,156 102,156 101,155 101,155 100,154 100,153 99,153 98,152 98,151 97,151 97,150 96,149 96,149 95,148 95,147 94,147 94,146 94,145 93,145 93,144 93,143 92,142 92,142 92,141 91,140 91,140 91,139 91,138 91,137 90,137 90,136 90,135 90,134 90,134 90,133 90,132 90,131 "/>
<polygon fill="rgb(209,44,0)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 103,157 103,163 157,138 "/>
<polygon fill="rgb(241,76,20)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 97,113 96,114 96,114 95,115 95,116 94,116 94,117 94,118 93,118 93,119 93,120 92,120 92,121 92,122 91,123 91,123 91,124 91,125 91,126 90,126 90,127 90,128 90,129 90,129 90,130 90,131 90,131 90,132 90,133 90,134 90,134 90,135 90,136 90,137 91,137 91,138 91,139 91,140 91,140 92,141 92,142 92,142 93,143 93,144 93,145 94,145 94,146 94,147 95,147 95,148 96,149 96,149 97,150 97,151 98,151 98,152 99,153 100,153 100,154 101,155 101,155 102,156 103,156 103,157 157,131 "/>
<polygon fill="rgb(210,160,61)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 224,131 224,138 157,138 "/>
<polygon fill="rgb(210,160,61)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="208,159 209,158 210,158 211,157 211,156 212,156 213,155 213,155 214,154 214,153 215,153 216,152 216,151 217,151 217,150 218,149 218,149 219,148 219,147 220,147 220,146 220,145 221,145 221,144 221,143 222,142 222,142 222,141 223,140 223,140 223,139 223,138 223,137 224,137 224,136 224,135 224,134 224,134 224,133 224,132 224,131 224,138 224,139 224,139 224,140 224,141 224,142 224,142 224,143 223,144 223,144 223,145 223,146 223,147 222,147 222,148 222,149 221,150 221,150 221,151 220,152 220,152 220,153 219,154 219,154 218,155 218,156 217,156 217,157 216,158 216,158 215,159 214,160 214,160 213,161 213,162 212,162 211,163 211,163 210,164 209,165 208,165 "/>
<polygon fill="rgb(210,160,61)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 208,159 208,165 157,138 "/>
<polygon fill="rgb(242,192,93)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 208,159 209,158 210,158 211,157 211,156 212,156 213,155 213,155 214,154 214,153 215,153 216,152 216,151 217,151 217,150 218,149 218,149 219,148 219,147 220,147 220,146 220,145 221,145 221,144 221,143 222,142 222,142 222,141 223,140 223,140 223,139 223,138 223,137 224,137 224,136 224,135 224,134 224,134 224,133 224,132 224,131 157,131 "/>
<polygon fill="rgb(46,119,136)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 103,157 103,163 157,138 "/>
<polygon fill="rgb(46,119,136)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="103,157 104,158 105,158 106,159 106,159 107,160 108,160 109,161 110,161 110,162 111,162 112,163 113,163 114,164 115,164 116,165 117,165 118,166 119,166 120,167 121,167 121,167 122,168 124,168 125,169 126,169 127,169 128,170 129,170 130,170 131,171 132,171 133,171 134,171 135,172 136,172 137,172 137,178 136,178 135,178 134,178 133,177 132,177 131,177 130,177 129,176 128,176 127,176 126,175 125,175 124,175 122,174 121,174 121,173 120,173 119,173 118,172 117,172 116,171 115,171 114,170 113,170 112,169 111,169 110,168 110,168 109,167 108,167 107,166 106,166 106,165 105,165 104,164 103,163 "/>
<polygon fill="rgb(46,119,136)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 137,172 137,178 157,138 "/>
<polygon fill="rgb(78,151,168)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 103,157 104,158 105,158 106,159 106,159 107,160 108,160 109,161 110,161 110,162 111,162 112,163 113,163 114,164 115,164 116,165 117,165 118,166 119,166 120,167 121,167 121,167 122,168 124,168 125,169 126,169 127,169 128,170 129,170 130,170 131,171 132,171 133,171 134,171 135,172 136,172 137,172 157,131 "/>
<polygon fill="rgb(11,32,75)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 137,172 137,178 157,138 "/>
<polygon fill="rgb(11,32,75)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="137,172 139,172 140,172 141,173 142,173 143,173 144,173 145,173 147,173 148,173 148,180 147,180 145,180 144,179 143,179 142,179 141,179 140,179 139,179 137,178 "/>
<polygon fill="rgb(11,32,75)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 148,173 148,180 157,138 "/>
<polygon fill="rgb(43,64,107)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 137,172 139,172 140,172 141,173 142,173 143,173 144,173 145,173 147,173 148,173 157,131 "/>
<polygon fill="rgb(0,91,67)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 148,173 148,180 157,138 "/>
<polygon fill="rgb(0,91,67)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="148,173 149,174 150,174 151,174 152,174 153,174 153,180 152,180 151,180 150,180 149,180 148,180 "/>
<polygon fill="rgb(0,91,67)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 153,174 153,180 157,138 "/>
<polygon fill="rgb(29,123,99)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 148,173 149,174 150,174 151,174 152,174 153,174 157,131 "/>
<polygon fill="rgb(147,0,0)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 153,174 153,180 157,138 "/>
<polygon fill="rgb(147,0,0)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 208,159 208,165 157,138 "/>
<polygon fill="rgb(147,0,0)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="153,174 155,174 156,174 157,174 158,174 159,174 161,174 162,174 163,174 164,174 165,174 166,173 167,173 169,173 170,173 171,173 172,173 173,173 174,172 175,172 177,172 178,172 179,172 180,171 181,171 182,171 183,171 184,170 185,170 186,170 187,169 188,169 189,169 190,168 192,168 193,167 193,167 194,167 195,166 196,166 197,165 198,165 199,164 200,164 201,163 202,163 203,162 204,162 204,161 205,161 206,160 207,160 208,159 208,159 208,165 208,166 207,166 206,167 205,167 204,168 204,168 203,169 202,169 201,170 200,170 199,171 198,171 197,172 196,172 195,173 194,173 193,173 193,174 192,174 190,175 189,175 188,175 187,176 186,176 185,176 184,177 183,177 182,177 181,177 180,178 179,178 178,178 177,178 175,179 174,179 173,179 172,179 171,179 170,179 169,180 167,180 166,180 165,180 164,180 163,180 162,180 161,180 159,180 158,180 157,180 156,180 155,180 153,180 "/>
<polygon fill="rgb(179,8,14)" fill-opacity="1" stroke="black" stroke-opacity="1"
points="157,131 153,174 155,174 156,174 157,174 158,174 159,174 161,174 162,174 163,174 164,174 165,174 166,173 167,173 169,173 170,173 171,173 172,173 173,173 174,172 175,172 177,172 178,172 179,172 180,171 181,171 182,171 183,171 184,170 185,170 186,170 187,169 188,169 189,169 190,168 192,168 193,167 193,167 194,167 195,166 196,166 197,165 198,165 199,164 200,164 201,163 202,163 203,162 204,162 204,161 205,161 206,160 207,160 208,159 208,159 157,131 "/>
<line x1="214" y1="110" x2="221" y2="107" fill="none"  stroke="white" stroke-opacity="1"/>
<rect  x="224" y="92"  width="31" height="17" fill="gray" fill-opacity="0.5" stroke="gray" stroke-opacity="0.5" rx="4" ry="4"/>
<rect  x="221" y="89"  width="31" height="17" fill="rgb(255,255,225)" fill-opacity="1" stroke="black" stroke-opacity="1" rx="4" ry="4"/>
<text x="228" y="102" font-family="Arial" font-size="8pt"  fill="black" fill-opacity="1">
Eric
</text>
<line x1="130" y1="79" x2="127" y2="73" fill="none"  stroke="white" stroke-opacity="1"/>
<rect  x="80" y="58"  width="49" height="17" fill="gray" fill-opacity="0.5" stroke="gray" stroke-opacity="0.5" rx="4" ry="4"/>
<rect  x="77" y="55"  width="49" height="17" fill="rgb(255,255,225)" fill-opacity="1" stroke="black" stroke-opacity="1" rx="4" ry="4"/>
<text x="84" y="68" font-family="Arial" font-size="8pt"  fill="black" fill-opacity="1">
Phones
</text>
<line x1="90" y1="136" x2="82" y2="136" fill="none"  stroke="white" stroke-opacity="1"/>
<rect  x="39" y="139"  width="45" height="17" fill="gray" fill-opacity="0.5" stroke="gray" stroke-opacity="0.5" rx="4" ry="4"/>
<rect  x="36" y="136"  width="45" height="17" fill="rgb(255,255,225)" fill-opacity="1" stroke="black" stroke-opacity="1" rx="4" ry="4"/>
<text x="43" y="149" font-family="Arial" font-size="8pt"  fill="black" fill-opacity="1">
Tables
</text>
<line x1="119" y1="166" x2="114" y2="171" fill="none"  stroke="white" stroke-opacity="1"/>
<rect  x="62" y="174"  width="54" height="17" fill="gray" fill-opacity="0.5" stroke="gray" stroke-opacity="0.5" rx="4" ry="4"/>
<rect  x="59" y="171"  width="54" height="17" fill="rgb(255,255,225)" fill-opacity="1" stroke="black" stroke-opacity="1" rx="4" ry="4"/>
<text x="66" y="184" font-family="Arial" font-size="8pt"  fill="black" fill-opacity="1">
Monitors
</text>
<line x1="143" y1="173" x2="141" y2="187" fill="none"  stroke="white" stroke-opacity="1"/>
<rect  x="98" y="190"  width="45" height="17" fill="gray" fill-opacity="0.5" stroke="gray" stroke-opacity="0.5" rx="4" ry="4"/>
<rect  x="95" y="187"  width="45" height="17" fill="rgb(255,255,225)" fill-opacity="1" stroke="black" stroke-opacity="1" rx="4" ry="4"/>
<text x="102" y="200" font-family="Arial" font-size="8pt"  fill="black" fill-opacity="1">
Lamps
</text>
<line x1="151" y1="174" x2="150" y2="202" fill="none"  stroke="white" stroke-opacity="1"/>
<rect  x="86" y="205"  width="66" height="17" fill="gray" fill-opacity="0.5" stroke="gray" stroke-opacity="0.5" rx="4" ry="4"/>
<rect  x="83" y="202"  width="66" height="17" fill="rgb(255,255,225)" fill-opacity="1" stroke="black" stroke-opacity="1" rx="4" ry="4"/>
<text x="90" y="215" font-family="Arial" font-size="8pt"  fill="black" fill-opacity="1">
Keyboards
</text>
<line x1="184" y1="170" x2="187" y2="175" fill="none"  stroke="white" stroke-opacity="1"/>
<rect  x="190" y="178"  width="39" height="17" fill="gray" fill-opacity="0.5" stroke="gray" stroke-opacity="0.5" rx="4" ry="4"/>
<rect  x="187" y="175"  width="39" height="17" fill="rgb(255,255,225)" fill-opacity="1" stroke="black" stroke-opacity="1" rx="4" ry="4"/>
<text x="194" y="188" font-family="Arial" font-size="8pt"  fill="black" fill-opacity="1">
Bikes
</text>
<line x1="220" y1="146" x2="228" y2="148" fill="none"  stroke="white" stroke-opacity="1"/>
<rect  x="231" y="151"  width="44" height="17" fill="gray" fill-opacity="0.5" stroke="gray" stroke-opacity="0.5" rx="4" ry="4"/>
<rect  x="228" y="148"  width="44" height="17" fill="rgb(255,255,225)" fill-opacity="1" stroke="black" stroke-opacity="1" rx="4" ry="4"/>
<text x="235" y="161" font-family="Arial" font-size="8pt"  fill="black" fill-opacity="1">
Chairs
</text>
<rect  x="315" y="37"  width="110" height="108" fill="black" fill-opacity="1"/>
<rect  x="312" y="34"  width="110" height="108" fill="white" fill-opacity="1" stroke="black" stroke-opacity="1"/>
<text x="330" y="47" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
630
</text>
<text x="355" y="47" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
Eric
</text>
<rect  x="319" y="39"  width="8" height="8" fill="silver" fill-opacity="0.5"/>
<rect  x="319" y="39"  width="6" height="6" fill="rgb(68,102,163)" fill-opacity="1" stroke="black" stroke-opacity="1"/>
<text x="330" y="60" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
921
</text>
<text x="355" y="60" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
Phones
</text>
<rect  x="319" y="52"  width="8" height="8" fill="silver" fill-opacity="0.5"/>
<rect  x="319" y="52"  width="6" height="6" fill="rgb(243,156,53)" fill-opacity="1" stroke="black" stroke-opacity="1"/>
<text x="330" y="73" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
637
</text>
<text x="355" y="73" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
Tables
</text>
<rect  x="319" y="65"  width="8" height="8" fill="silver" fill-opacity="0.5"/>
<rect  x="319" y="65"  width="6" height="6" fill="rgb(241,76,20)" fill-opacity="1" stroke="black" stroke-opacity="1"/>
<text x="330" y="86" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
355
</text>
<text x="355" y="86" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
Monitors
</text>
<rect  x="319" y="78"  width="8" height="8" fill="silver" fill-opacity="0.5"/>
<rect  x="319" y="78"  width="6" height="6" fill="rgb(78,151,168)" fill-opacity="1" stroke="black" stroke-opacity="1"/>
<text x="337" y="99" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
98
</text>
<text x="355" y="99" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
Lamps
</text>
<rect  x="319" y="91"  width="8" height="8" fill="silver" fill-opacity="0.5"/>
<rect  x="319" y="91"  width="6" height="6" fill="rgb(43,64,107)" fill-opacity="1" stroke="black" stroke-opacity="1"/>
<text x="337" y="112" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
42
</text>
<text x="355" y="112" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
Keyboards
</text>
<rect  x="319" y="104"  width="8" height="8" fill="silver" fill-opacity="0.5"/>
<rect  x="319" y="104"  width="6" height="6" fill="rgb(29,123,99)" fill-opacity="1" stroke="black" stroke-opacity="1"/>
<text x="330" y="125" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
541
</text>
<text x="355" y="125" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
Bikes
</text>
<rect  x="319" y="117"  width="8" height="8" fill="silver" fill-opacity="0.5"/>
<rect  x="319" y="117"  width="6" height="6" fill="rgb(179,8,14)" fill-opacity="1" stroke="black" stroke-opacity="1"/>
<text x="330" y="138" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
398
</text>
<text x="355" y="138" font-family="Verdana" font-size="8pt"  fill="black" fill-opacity="1">
Chairs
</text>
<rect  x="319" y="130"  width="8" height="8" fill="silver" fill-opacity="0.5"/>
<rect  x="319" y="130"  width="6" height="6" fill="rgb(242,192,93)" fill-opacity="1" stroke="black" stroke-opacity="1"/>
</svg>

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Spurious triangles in Pie Chart's SVG Export

Post by Yeray » Fri Jan 12, 2018 8:18 am

Hello Ian,

Regarding the extensions allowed in this forum, note you should be able to put your .svg file in a .zip and attach it here.
Another alternative would be to open the .svg and make an screenshot to generate a .png and attach it here.

Regarding the wrong triangles, I've tested 3D several times and it always gives me a correct result, ie:

Code: Select all

uses Series, TeeSVGCanvas;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TPieSeries).FillSampleValues;
  TeeSaveToSVGFile(Chart1, 'E:\tmp\exports\pie.svg', 500, 300);
end;
Screenshot of the .svg:
iexplore_2018-01-12_09-10-40.png
iexplore_2018-01-12_09-10-40.png (17.24 KiB) Viewed 16115 times
In your case, it seems only the shadow is messed up, and removing those polygons you are removing that shadow.

On the other hand, in 2D I always get a completely messed up chart. Actually, the shadow seems to be correct:

Code: Select all

uses Series, TeeSVGCanvas;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=False;
  Chart1.AddSeries(TPieSeries).FillSampleValues;

  TeeSaveToSVGFile(Chart1, 'E:\tmp\exports\pie.svg', 500, 300);
end;
Screenshot of the .svg:
iexplore_2018-01-12_09-14-44.png
iexplore_2018-01-12_09-14-44.png (30.87 KiB) Viewed 16125 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

IanK
Newbie
Newbie
Posts: 5
Joined: Mon Sep 04, 2017 12:00 am

Re: Spurious triangles in Pie Chart's SVG Export

Post by IanK » Fri Jan 12, 2018 9:27 am

Yeray wrote:Hello Ian,

Regarding the extensions allowed in this forum, note you should be able to put your .svg file in a .zip and attach it here.
Another alternative would be to open the .svg and make an screenshot to generate a .png and attach it here.

Regarding the wrong triangles, I've tested 3D several times and it always gives me a correct result, ie:
Hi Yeray,

Thanks for running those tests; FWIW I'm still repeatably getting the odd triangle/shadow behaviour here (I've checked, and I'm using the 2017.23 version of the code) - the attached project's what I'm using to generate it. (I tried attaching the built EXE, but that led to a ZIP exceeding the forum size limits.)

Regards,
Ian
Attachments
TeeSVGTest.zip
(54.56 KiB) Downloaded 888 times

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Spurious triangles in Pie Chart's SVG Export

Post by Yeray » Fri Jan 12, 2018 12:43 pm

Hello Ian,

The fix just implemented for #1965 seems to fix the problem you are experiencing with the shadows.
In v2017.23 I get this with your project:
iexplore_2018-01-12_13-39-41.png
iexplore_2018-01-12_13-39-41.png (25.27 KiB) Viewed 16121 times
And I get this with the fix:
iexplore_2018-01-12_13-39-50.png
iexplore_2018-01-12_13-39-50.png (19.01 KiB) Viewed 16117 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

IanK
Newbie
Newbie
Posts: 5
Joined: Mon Sep 04, 2017 12:00 am

Re: Spurious triangles in Pie Chart's SVG Export

Post by IanK » Mon Jan 15, 2018 9:44 am

Yeray wrote:Hello Ian,

The fix just implemented for #1965 seems to fix the problem you are experiencing with the shadows.
Excellent - thanks for your help with this, Yeray!

Post Reply