Thanks again, Peter. That does help. I opened a bug in Apache’s JIRA before 
your first response. I’ll add this info there as a comment. If the maintainers 
decide to improve the handling of that, then great. But I’ll also see about 
opening a defect against XChart.

From: Peter Hull <peterhul...@gmail.com>
Date: Wednesday, June 5, 2024 at 1:48 AM
To: batik-users@xmlgraphics.apache.org <batik-users@xmlgraphics.apache.org>
Subject: Re: Batik cannot render bar charts generated by XChart
Alright I might have found something.
In your 'bar.svg', line 92 has:
    <path d="M531.1467011718751,517.4706589889436
L658.3522441406251,517.4706589889436 L658.3522441406251,536.894375
L531.1467011718751,536.894375 Z L-1.7976931348623157E308,536.894375 Z"
style="fill:rgb(0,115,157);stroke:none;"/>

The path ends with "Z L...,... Z" which I think is not great: Z closes
the path and then draws one more Line and then closes the path again.
However Batik is OK with that, the actual problem is the x-coord of
that last line which is -1.7976931348623157E308 i.e. a very large
negative number.

I have made this minimal SVG which Batik also renders as a completely
black image. Edge browser shows a blue square.

<svg height="750px" version="1.1" viewBox="0 0 700 750" width="700px"
x="0px" y="0px" xmlns="http://www.w3.org/2000/svg ">
    <path d="M100,100 H600 V600 H100 Z L-1e308,0 Z"
style="fill:rgb(0,115,157);stroke:none;"/>
</svg>

I don't know what the SVG spec says about the allowed range of
numbers, so maybe this is invalid SVG, but it seems to me that Batik
could handle this better.

Hope that helps

Peter

On Tue, 4 Jun 2024 at 00:07, McIntyre, Eric <eric.mcint...@hpe.com> wrote:
>
> Thank you, Peter. I appreciate it. I’ll see if I can work something simpler 
> up.
>
>
>
> From: Peter Hull <peterhul...@gmail.com>
> Date: Monday, June 3, 2024 at 2:07 PM
> To: batik-users@xmlgraphics.apache.org <batik-users@xmlgraphics.apache.org>
> Subject: Re: Batik cannot render bar charts generated by XChart
>
> On Wed, 29 May 2024 at 17:57, McIntyre, Eric <eric.mcint...@hpe.com> wrote:
>
>
>
> I don’t know enough about SVGs to be able to see anything wrong with those 
> bar charts. I was hoping someone here could tell me what’s happening. Is the 
> SVG invalid? Does it use some part of SVG that’s unsupported by Batik? Is 
> there a bug in Batik?
>
> I can say that they render ok on Firefox and Safari, and in Inkscape, but do 
> not on an old (1.8) version of Batik I had on my mac - therefore I agree with 
> you it's either a bug or an unsupported feature. I will see if I can get any 
> further if I have time. Is there any way to simplify the bar charts to get to 
> a more minimal non-rendering SVG?
>
> Pete
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org

Reply via email to