1. #1
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    675
    Answers
    6
    Vote Rating
    12
    Dumbledore will become famous soon enough

      0  

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

    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
    31
    Vote Rating
    85
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      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
    675
    Answers
    6
    Vote Rating
    12
    Dumbledore will become famous soon enough

      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
    31
    Vote Rating
    85
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      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!

Thread Participants: 1