Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [swtchart-dev] GSoC 2020:Exporting *.svg files via Inkscape

Yep, using a template allows people to export the data in different styles, see attached and example template.

This approach doesn't require to use Apache Batik and so on. It can be implemented by just using a FileReader for the template and a PrintWriter to export the data. The XY bar and line series data can be fetched dynamically from the BaseChart, see R export.


Best,
Philip


Am 27.02.20 um 14:58 schrieb Yash Bharatiya:
Okay,
So does that mean the basic features of the .svg file like font,color and styling will remain the same every time the user makes an export,
and only the data series for different axes being exported will change?
Thanks,
Yash

On Thu, 27 Feb 2020 at 18:49, Philip Wenig <philip.wenig@xxxxxxxxxxxxx> wrote:
I would recommend to create a simple *.svg template in Inkscape for each type, which could be used internally, see attached very rough demo file.

The template *.svg files could be modified in a way, that certain keywords for the X and Y axis are used and a data area is defined. This would enable a system, that a user could use its own *.svg templates in step 2 to export the data.

Do you know what I mean?


Best,
Philip

Am 27.02.20 um 14:07 schrieb Yash Bharatiya:
Hi,
Yes, I meant using this SVG code generated by batik as a reference to create the template for different charts
For e.g-

PrintWriter printWriter = null;



/*

USE PRINTWRITER TO PRINT SVG CODE TO A FILE HERE

*/

 printWriter=new PrintWriter(new File(filename));

/*

printWriter.println(); // SVG code to print to the file goes inside this print statement.




Sincerely,

Yash



On Thu, 27 Feb 2020 at 18:13, Philip Wenig <philip.wenig@xxxxxxxxxxxxx> wrote:
Hi Yash,

the current SVG export is fine and uses Apache Batik and other dependencies to export the data.

I would like to have a second solution without using these dependencies, via a template. The template for Bar-, Line- and Scatter-Charts shall define one x and one y axis, which is populated by the export script. The line series shall be exported as "one" connected line instead of separate elements.


Best,
Philip

Am 26.02.20 um 15:18 schrieb Yash Bharatiya:
Hi,
I looked into how Graphics2D generated the .svg export for different charts and found 
that it consists of three sections of code-
1) General declaration of  xml document and SVG object,this will be common to all templates.
for e.g-
<svg>
<g>
<defs id="defs1">
<clipPath clipPathUnits="userSpaceOnUse" id="clipPath1"
      ><path d="M50 50 L876 50 L876 317 L50 317 L50 50 Z"/>
</clipPath>
</defs>
<g style="fill:red; stroke:red;" transform="translate(50,0)"

2) Filling of data series in the chart ,this is the only section of code which differs in the template of each chart   
for e.g. -
in line chart it is done as -
<line x1="50" x2="50" y1="316" style="fill:none; clip-path:url(#clipPath1);" y2="316"/>

3) Defining the axes and giving effects to the chart,this will depend on the data series the user is exporting.

Does this look fine?

Thanks,
Yash



_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev

-- 
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev

_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev

-- 
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev

_______________________________________________
swtchart-dev mailing list
swtchart-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/swtchart-dev

-- 
~~~~~~~~~~~~~~~~~~~~~~~~
OpenChrom - the open source alternative for chromatography / mass spectrometry
Dr. Philip Wenig » Founder » philip.wenig@xxxxxxxxxxxxx » http://www.openchrom.net
~~~~~~~~~~~~~~~~~~~~~~~~

Attachment: Bildschirmfoto vom 2020-02-28 11-13-50.png
Description: PNG image

Attachment: Template-LineChart.svg
Description: image/svg


Back to the top