Results 1 to 4 of 4

Thread: Send a chart per mail... How?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    720
    Answers
    7
    Vote Rating
    36
      0  

    Default Unanswered: Send a chart per mail... How?

    For an intranet application i need a way to send a sencha chart per mail. Because this app has no connection to the internet it must be a php way.

    Any ideas except phantomjs?

    Bye, Dumbledore

  2. #2
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Answers
    32
    Vote Rating
    88
      1  

    Default

    I've done something similar in my intranet app. When saving the chart, I use type "image/svg+xml". Then, I post the svg content to my server, where some utilities convert the svg/xml to a .png file which can be downloaded, emailed, whatever.

    Here's the code from my controller:

    Code:
    saveChart: function( btn, e, opts ) {
    	var me = this,
    	window = btn.up( 'window' ),
    	chart = window.down( 'chart' ),
    	formEl = Ext.get(document.createElement('form')),
    	svgEl = Ext.get(document.createElement('input')),
    	svgContent;
    			
            svgContent = chart.save({
    		type: 'image/svg+xml'
    	});
    	formEl.set({
                action: 'reports/savechart',
                method: 'POST',
    	    target: '_blank'
            });
    	svgEl.set({
                name: 'svg',
                type: 'hidden',
    	    value: svgContent
    	});
            formEl.appendChild(svgEl);        
            Ext.getBody().appendChild(formEl);
    		formEl.dom.submit();
    	}

  3. #3
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    720
    Answers
    7
    Vote Rating
    36
      0  

    Default

    cool... can you recommend server side tools for convert svg to png?

    Thanks!

    Dumbledore

  4. #4
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Answers
    32
    Vote Rating
    88
      1  

    Default

    Quote Originally Posted by Dumbledore View Post
    cool... can you recommend server side tools for convert svg to png?

    Thanks!

    Dumbledore
    This is one I've had luck with: http://xmlgraphics.apache.org/batik/

    Good luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •