Skip to content

Instantly share code, notes, and snippets.

@vedovelli
Created September 30, 2016 18:39
Show Gist options
  • Save vedovelli/5d72bdce47440be52b9b936280e91679 to your computer and use it in GitHub Desktop.
Save vedovelli/5d72bdce47440be52b9b936280e91679 to your computer and use it in GitHub Desktop.
$svg = "<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg version="1.1" style="font-family:&quot;Lucida Grande&quot;, &quot;Lucida Sans Unicode&quot;, Arial, Helvetica, sans-serif;font-size:12px;" xmlns="http://www.w3.org/2000/svg" width="600" height="400"><desc>Created with Highcharts 4.2.5</desc><defs><clipPath id="highcharts-1"><rect x="0" y="0" width="600" height="400"/></clipPath></defs><rect x="0" y="0" width="600" height="400" fill="#FFFFFF" class=" highcharts-background"/><g class="highcharts-series-group"><g class="highcharts-series highcharts-series-0 highcharts-tracker" transform="translate(10,10) scale(1 1)" style="cursor:pointer;"><path fill="rgb(218,40,28)" d="M 386.42117941589436 89.15410763569923 L 386.42117941589436 102.27910763569923 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(7,124,217)" d="M 374.5187008326802 295.1598928846466 L 374.5187008326802 308.2848928846466 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(218,40,28)" d="M 272.9673104508069 48.502925575589785 L 272.9673104508069 61.627925575589785 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(230,126,0)" d="M 429.7009318838424 157.43671741057616 L 429.7009318838424 170.56171741057616 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(218,40,28)" d="M 272.9673104508069 48.502925575589785 C 317.2651276126073 48.49511205318696 355.07873298953405 62.04394710437069 386.42117941589436 89.15410763569923 L 386.42117941589436 102.27910763569923 C 355.07873298953405 75.16894710437069 317.2651276126073 61.62011205318696 272.9673104508069 61.627925575589785 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(218,40,28)" d="M 273 187.5 C 273 187.5 273 187.5 273 187.5 L 273 200.625 C 273 200.625 273 200.625 273 200.625 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(230,126,0)" d="M 386.42231501077185 89.15508989684352 L 386.42231501077185 102.28008989684352 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(50,149,56)" d="M 426.75263027962853 227.37836520686233 L 426.75263027962853 240.50336520686233 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(230,126,0)" d="M 386.42231501077185 89.15508989684352 C 409.10033427288266 108.77120507150872 422.7684358255298 130.33567007682277 429.7009318838424 157.43671741057616 L 429.7009318838424 170.56171741057616 C 422.7684358255298 143.46067007682277 409.10033427288266 121.89620507150872 386.42231501077185 102.28008989684352 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(230,126,0)" d="M 273 187.5 C 273 187.5 273 187.5 273 187.5 L 273 200.625 C 273 200.625 273 200.625 273 200.625 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(50,149,56)" d="M 429.7012790168932 157.4380744819574 L 429.7012790168932 170.5630744819574 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(37,55,155)" d="M 399.9912914545382 272.5005671806453 L 399.9912914545382 285.6255671806453 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(50,149,56)" d="M 433.5 187.5 C 433.5 201.72089425921084 431.46379135823275 213.75531288734746 426.75263027962853 227.37836520686233 L 426.75263027962853 240.50336520686233 C 431.46379135823275 226.88031288734746 433.5 214.84589425921084 433.5 200.625 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(50,149,56)" d="M 273 187.5 C 273 187.5 273 187.5 273 187.5 L 273 200.625 C 273 200.625 273 200.625 273 200.625 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(37,55,155)" d="M 426.75216979624315 227.37969674170557 L 426.75216979624315 240.50469674170557 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(130,14,149)" d="M 374.51994397696706 295.1590137015248 L 374.51994397696706 308.2840137015248 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(37,55,155)" d="M 426.75216979624315 227.37969674170557 C 420.8103617145884 244.56073044510154 412.6558074434729 258.3099273905881 399.9912914545382 272.5005671806453 L 399.9912914545382 285.6255671806453 C 412.6558074434729 271.4349273905881 420.8103617145884 257.6857304451015 426.75216979624315 240.50469674170557 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(37,55,155)" d="M 273 187.5 C 273 187.5 273 187.5 273 187.5 L 273 200.625 C 273 200.625 273 200.625 273 200.625 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(130,14,149)" d="M 399.9903099461818 272.50166695323986 L 399.9903099461818 285.62666695323986 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(7,124,217)" d="M 272.93596364995625 48.50293375574648 L 272.93596364995625 61.62793375574648 L 273 200.625 L 273 187.5 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(130,14,149)" d="M 399.9903099461818 272.50166695323986 C 392.12246515892303 281.31743566656473 384.4849769006029 288.111418130887 374.51994397696706 295.1590137015248 L 374.51994397696706 308.2840137015248 C 384.4849769006029 301.236418130887 392.12246515892303 294.44243566656473 399.9903099461818 285.62666695323986 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(130,14,149)" d="M 273 187.5 C 273 187.5 273 187.5 273 187.5 L 273 200.625 C 273 200.625 273 200.625 273 200.625 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(7,124,217)" d="M 374.5187008326802 295.1598928846466 C 305.8614573513944 343.7155386378048 204.75229401677 334.8766908889006 148.68506372424602 275.4177738802935 C 124.24228097581317 249.49636875084715 112.5 220.96649765437377 112.5 187.50000000000003 L 112.5 200.62500000000003 C 112.49999999999999 123.8785323954609 184.3167832417271 61.658554090102534 272.93596364995625 61.62793375574648 L 272.93596364995625 48.50293375574648 C 184.3167832417271 48.533554090102534 112.49999999999999 110.7535323954609 112.5 187.50000000000003 L 112.5 200.62500000000003 C 112.50000000000001 277.3909660679302 184.35829765215763 339.6220773074024 273 339.6220773074024 C 311.6437828591733 339.6220773074024 344.5872403741618 329.45296368397345 374.5187008326802 308.2848928846466 Z" transform="translate(0,0)" visibility="visible"/><path fill="rgb(7,124,217)" d="M 273 187.5 C 273 187.5 273 187.5 273 187.5 C 273 187.5 273 187.5 273 187.5 C 273 187.5 273 187.5 273 187.5 L 273 200.625 C 273 200.625 273 200.625 273 200.625 C 273 200.625 273 200.625 273 200.625 C 273 200.625 273 200.625 273 200.625 Z" transform="translate(0,0)" visibility="visible"/><g stroke="#F34135" stroke-width="1" stroke-linejoin="round"><path fill="#F34135" d="M 272.9673104508069 48.502925575589785 C 317.2651276126073 48.49511205318696 355.07873298953405 62.04394710437069 386.42117941589436 89.15410763569923 L 273 187.5 C 273 187.5 273 187.5 273 187.5 Z" transform="translate(0,0)" visibility="visible"/></g><g stroke="#FF9700" stroke-width="1" stroke-linejoin="round"><path fill="#FF9700" d="M 386.42231501077185 89.15508989684352 C 409.10033427288266 108.77120507150872 422.7684358255298 130.33567007682277 429.7009318838424 157.43671741057616 L 273 187.5 C 273 187.5 273 187.5 273 187.5 Z" transform="translate(0,0)" visibility="visible"/></g><g stroke="#4BAE51" stroke-width="1" stroke-linejoin="round"><path fill="#4BAE51" d="M 429.7012790168932 157.4380744819574 C 435.9133811441846 181.72405247459835 434.9932360647028 203.5493765814461 426.75263027962853 227.37836520686233 L 273 187.5 C 273 187.5 273 187.5 273 187.5 Z" transform="translate(0,0)" visibility="visible"/></g><g stroke="#3E50B4" stroke-width="1" stroke-linejoin="round"><path fill="#3E50B4" d="M 426.75216979624315 227.37969674170557 C 420.8103617145884 244.56073044510154 412.6558074434729 258.3099273905881 399.9912914545382 272.5005671806453 L 273 187.5 C 273 187.5 273 187.5 273 187.5 Z" transform="translate(0,0)" visibility="visible"/></g><g stroke="#9B27AE" stroke-width="1" stroke-linejoin="round"><path fill="#9B27AE" d="M 399.9903099461818 272.50166695323986 C 392.12246515892303 281.31743566656473 384.4849769006029 288.111418130887 374.51994397696706 295.1590137015248 L 273 187.5 C 273 187.5 273 187.5 273 187.5 Z" transform="translate(0,0)" visibility="visible"/></g><g stroke="#2095F2" stroke-width="1" stroke-linejoin="round"><path fill="#2095F2" d="M 374.5187008326802 295.1598928846466 C 305.8614573513944 343.7155386378048 204.75229401677 334.8766908889006 148.68506372424602 275.4177738802935 C 92.61783343172203 215.95885687168644 102.82405568603394 128.39575286851158 171.48129916731978 79.8401071153534 C 201.39532076826725 58.68436939186265 234.31469875092813 48.51627845199637 272.93596364995625 48.50293375574648 L 273 187.5 C 273 187.5 273 187.5 273 187.5 C 273 187.5 273 187.5 273 187.5 C 273 187.5 273 187.5 273 187.5 Z" transform="translate(0,0)" visibility="visible"/></g></g><g class="highcharts-markers highcharts-series-0" transform="translate(10,10) scale(1 1)"/></g><g class="highcharts-button" style="cursor:default;" stroke-linecap="round" transform="translate(566,10)"><title>Chart context menu</title><rect x="0.5" y="0.5" width="24" height="22" fill="white" stroke="none" stroke-width="1" rx="2" ry="2"/><path fill="#E0E0E0" d="M 6 6.5 L 20 6.5 M 6 11.5 L 20 11.5 M 6 16.5 L 20 16.5" stroke="#666" stroke-width="3"/><text x="0" style="color:black;fill:black;" y="12"></text></g><g class="highcharts-data-labels highcharts-series-0 highcharts-tracker" visibility="visible" transform="translate(10,10) scale(1 1)" opacity="1" style="cursor:pointer;"><path fill="none" d="M 387.1260959260164 31.353449644425798 C 382.1260959260164 31.353449644425798 342.8005754841115 38.74519654641354 338.5934175097267 48.9088485366467 L 334.3862595353419 59.072500526879864" stroke="#F34135" stroke-width="1"/><path fill="none" d="M 450.27768331672075 106.1940971944614 C 445.27768331672075 106.1940971944614 432.98985220982286 110.04302837076447 423.3466282410116 115.33530873818118 L 413.7034042722004 120.62758910559789" stroke="#FF9700" stroke-width="1"/><path fill="none" d="M 468.39859000178865 193.71505634172397 C 463.39859000178865 193.71505634172397 455.37675956033263 193.42110405780892 444.3841877512167 193.01691966742573 L 433.39161594210077 192.61273527704253" stroke="#4BAE51" stroke-width="1"/><path fill="none" d="M 452.143012958431 264.72992320182476 C 447.143012958431 264.72992320182476 435.3296532548511 261.0740922705626 425.545400181956 256.0473247400773 L 415.76114710906086 251.02055720959194" stroke="#3E50B4" stroke-width="1"/><path fill="none" d="M 427.66407399647096 305.35972575387603 C 422.66407399647096 305.35972575387603 403.7899978136121 299.780323659578 395.90676506868203 292.1086457799181 L 388.02353232375197 284.4369679002582" stroke="#9B27AE" stroke-width="1"/><path fill="none" d="M 86.14771614333677 244.24501613459614 C 91.14771614333677 244.24501613459614 101.09669193481776 241.55867503813434 111.45798721545887 237.86495603049934 L 121.81928249609999 234.17123702286435" stroke="#2095F2" stroke-width="1"/><g style="cursor:pointer;" transform="translate(392,21)"><text x="5" style="font-size:11px;font-weight:bold;color:#000000;width:128px;text-shadow:0 0 6px #FFFFFF, 0 0 3px #FFFFFF;fill:#000000;text-rendering:geometricPrecision;" y="16"><tspan>GREATBATCH W</tspan></text></g><g style="cursor:pointer;" transform="translate(455,96)"><text x="5" style="font-size:11px;font-weight:bold;color:#000000;width:128px;text-shadow:0 0 6px #FFFFFF, 0 0 3px #FFFFFF;fill:#000000;text-rendering:geometricPrecision;" y="16"><tspan>EVEREADY BATTERY</tspan></text></g><g style="cursor:pointer;" transform="translate(473,184)"><text x="5" style="font-size:11px;font-weight:bold;color:#000000;width:128px;text-shadow:0 0 6px #FFFFFF, 0 0 3px #FFFFFF;fill:#000000;text-rendering:geometricPrecision;" y="16"><tspan>MEDTRONIC</tspan></text></g><g style="cursor:pointer;" transform="translate(457,255)"><text x="5" style="font-size:11px;font-weight:bold;color:#000000;width:128px;text-shadow:0 0 6px #FFFFFF, 0 0 3px #FFFFFF;fill:#000000;text-rendering:geometricPrecision;" y="16"><tspan>GREATBATCH</tspan></text></g><g style="cursor:pointer;" transform="translate(433,295)"><text x="5" style="font-size:11px;font-weight:bold;color:#000000;width:128px;text-shadow:0 0 6px #FFFFFF, 0 0 3px #FFFFFF;fill:#000000;text-rendering:geometricPrecision;" y="16"><tspan>GILLETTE CO</tspan></text></g><g style="cursor:pointer;" transform="translate(33,234)"><text x="5" style="font-size:11px;font-weight:bold;color:#000000;width:128px;text-shadow:0 0 6px #FFFFFF, 0 0 3px #FFFFFF;fill:#000000;text-rendering:geometricPrecision;" y="16"><tspan>Others</tspan></text></g></g><g class="highcharts-legend"><g><g/></g></g><g class="highcharts-tooltip" style="cursor:default;padding:0;pointer-events:none;white-space:nowrap;" transform="translate(0,-9999)"><path fill="none" d="M 3.5 0.5 L 13.5 0.5 C 16.5 0.5 16.5 0.5 16.5 3.5 L 16.5 13.5 C 16.5 16.5 16.5 16.5 13.5 16.5 L 3.5 16.5 C 0.5 16.5 0.5 16.5 0.5 13.5 L 0.5 3.5 C 0.5 0.5 0.5 0.5 3.5 0.5" isShadow="true" stroke="black" stroke-opacity="0.049999999999999996" stroke-width="5" transform="translate(1, 1)"/><path fill="none" d="M 3.5 0.5 L 13.5 0.5 C 16.5 0.5 16.5 0.5 16.5 3.5 L 16.5 13.5 C 16.5 16.5 16.5 16.5 13.5 16.5 L 3.5 16.5 C 0.5 16.5 0.5 16.5 0.5 13.5 L 0.5 3.5 C 0.5 0.5 0.5 0.5 3.5 0.5" isShadow="true" stroke="black" stroke-opacity="0.09999999999999999" stroke-width="3" transform="translate(1, 1)"/><path fill="none" d="M 3.5 0.5 L 13.5 0.5 C 16.5 0.5 16.5 0.5 16.5 3.5 L 16.5 13.5 C 16.5 16.5 16.5 16.5 13.5 16.5 L 3.5 16.5 C 0.5 16.5 0.5 16.5 0.5 13.5 L 0.5 3.5 C 0.5 0.5 0.5 0.5 3.5 0.5" isShadow="true" stroke="black" stroke-opacity="0.15" stroke-width="1" transform="translate(1, 1)"/><path fill="rgba(249, 249, 249, .85)" d="M 3.5 0.5 L 13.5 0.5 C 16.5 0.5 16.5 0.5 16.5 3.5 L 16.5 13.5 C 16.5 16.5 16.5 16.5 13.5 16.5 L 3.5 16.5 C 0.5 16.5 0.5 16.5 0.5 13.5 L 0.5 3.5 C 0.5 0.5 0.5 0.5 3.5 0.5"/><text x="8" style="font-size:12px;color:#333333;fill:#333333;" y="20"></text></g><text x="590" text-anchor="end" style="cursor:pointer;color:#909090;font-size:9px;fill:#909090;" y="395"><tspan>octimine technologies</tspan></text></svg>";
$imagick = new \Imagick();
$imagick->setResolution(86, 86);
$imagick->readImageBlob($svg);
$imagick->setImageFormat('png32');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment