Mille
Posts: 30
Joined: Wed Jan 23, 2019 7:28 pm

getSVG() in Powerpoint

Hi,

I'm using getSVG() to place charts inside of a Powerpoint presentation.

The issue I'm having is that the data points get surrounded by a black box (see screenshot below).

On the other hand, adding the SVG to an ordinary svg file and opening it nativly on OSX looks correct, so I'm thinking it's the way it's handled by powerpoint.

Where can those black boxes be coming from? Any suggestions of things that could remove them from the getSVG() export?
Untitled 2.png
Untitled 2.png (76.59 KiB) Viewed 388 times

After some further digging, I found that this is the SVG code (rect) causing it:

Code: Select all

<g class="highcharts-label highcharts-data-label highcharts-data-label-color-1" data-z-index="1"
           transform="translate(138,165)">
            <rect fill="rgb(0, 0, 0)" fill-opacity=" 0" class="highcharts-label-box highcharts-data-label-box" x="0"
                  y="0" width="55" height="44" rx="0" ry="0"></rect>
            <text x="16" data-z-index="1" y="27" style="color:#000000;font-size:11px;font-weight:bold;fill:#000000;">
                <tspan class="highcharts-text-outline" fill="#FFFFFF" stroke="#FFFFFF" stroke-width="2px"
                       stroke-linejoin="round">9999942.9
                    <tspan x="16" y="27">​</tspan>
                </tspan>
                8888842.9
            </text>
        </g>
Would it be possible to remove the "black rectangle" by adding any options to highcharts before the chart is rendered (since it seems not to be needed)?

The chart should be looking like this (nothing fancy):
Untitled 3.png
Untitled 3.png (92.85 KiB) Viewed 388 times
Mille
Posts: 30
Joined: Wed Jan 23, 2019 7:28 pm

Re: getSVG() in Powerpoint

Solved, it was the dataLabels which had a backgroundColor set (for the sake of adding padding)
jedrzej.r
Posts: 725
Joined: Tue Jan 24, 2023 11:21 am

Re: getSVG() in Powerpoint

I'm glad to hear that you managed to solve this issue.

In case of any other questions, feel free to ask anytime!
Best regards!
Jędrzej Ruta
Highcharts Developer

Return to “Highcharts Stock”