-
-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
Hi,
I am using JFreeSVG in combination with JFreeChart to produce SVG images to be embedded later on in HTML.
My problem is that the generated SVG file is huge (as example: plotting a single measurement where the sampling rate is 1ms, the time (X) is 270 seconds long (270k data points) produces an SVG file of 180MB. The picture is perfect but it simpy kills any browser I try to open with.
Question: How can I reduce (drastically) the generated SVG size?
The code generating the SVG (Kotlin):
val chart = createChart(sigData) ?: return@action
val g2 = SVGGraphics2D(600, 400).apply {
shapeRendering = "optimizeSpeed"
}
chart.draw(g2, Rectangle(0, 0, 600, 400))
SVGUtils.writeToSVG(calculateExportFile(), g2.svgElement)
I also tried using SVGHints with no luck.
Thanks a lot,
David
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels