JARCH SHOWCASE
JARCH SHOWCASE
Charts - Export Charts are canvas based and can be exported as static images with client side api.

Chart as an Image
<a:chart type="line" value="#{chartView.lineModel1}" style="width:500px;height:300px" widgetVar="chart"/>
            
<a:commandButton type="button" value="Export" icon="ui-icon-extlink" onclick="exportChart()"/>

<a:dialog widgetVar="dlg" showEffect="fade" modal="true" header="Chart as an Image" resizable="false">
    <a:outputPanel id="output" layout="block" style="width:500px;height:300px"/>
</a:dialog>

<script type="text/javascript">
function exportChart() {
    //export image
    $('#output').empty().append(PF('chart').exportAsImage());

    //show the dialog
    PF('dlg').show();
}
</script>
                
JARCH, Copyright © 2022 All rights reserved. Running JARCH 24.3.0-SNAPSHOT on PrimeFaces-12.0.0 on Mojarra-2.3.13.