Search the Community

Showing results for tags 'JavaScript'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Company Forums
    • Company News
  • Product Forums
    • FusionCharts XT
    • FusionWidgets XT
    • PowerCharts XT
    • FusionMaps XT
    • Collabion Charts for SharePoint
    • jQuery Plugin for FusionCharts
    • AngularJS plugin
    • ReactJS plugin
  • General Forums
    • FusionCharts Jobs and Consultation
    • FusionLounge

Found 61 results

  1. Hi folks, We recently upgraded our Flash-based FusionCharts to JS-only (version 3.4). Our clients have noticed a slowdown in chart rendering speed, and we're looking for ways to improve performance. We regularly request large amounts of data at a time (up to 5 years of daily data), so the slowness is most noticeable on these large date ranges. We noticed that one way to cut down chart rendering time considerably is to set drawAnchors = 0. This speeds up chart rendering significantly (from 7 to 2 seconds, for example). Right now, we're drawing anchors, but setting them to transparent so we can use tooltips. We can't lose the tooltip functionality, so I'm wondering if either of the following is possible: 1) Is there a way to include tooltips without drawing the anchors? 2) If not, is there any way to split the chart rendering into stages? E.g., draw the chart first without anchors, and then later render the anchors and tooltips? Any other performance improvement ideas you have would definitely be welcome, too. Thanks!
  2. Hi, I tried to use your product Fusion XT for a prototype I was building for generating maps in Siebel. But Siebel internally uses require.js to load js files and I was getting errors in loading fusioncharts js files. A little bit of digging and I realized the problem was with the loading of the eve and other Raphael components through require.js . I understand Raphael natively doesnt support require.js or AMD as such but since RedRaphael is your own fork I suggest you to include support for same from your side. Your code was obfuscated, else I could have separated the components for individual loading. For now I think I will have to look elsewhere.
  3. Hi, I'm using an angular gauge which is updated in real-time with values received from the server. If the upper limit of the gauge is currently 200, and I receive a value of 250, then I want to increase the upper limit of the gauge to something slightly larger than 250 before displaying this new value. My effort at implementing this is shown below: chart.addEventListener("RealtimeUpdateComplete", function (event, parameter) { var newValue = event.sender.getData(1); var currentUpperLimit = parseInt(chart.getChartAttribute("upperLimit")); if (newValue > currentUpperLimit) { var newUpperLimit = newValue * 1.2; chartRef.setChartAttribute("upperLimit", newUpperLimit); chartRef.setChartAttribute("upperLimitDisplay", newUpperLimit); } } ); This seemed to be the right approach, however when a value is received from the server which is larger than the upper limit of the gauge, the variable newValue is always set to 0. Strangely, this variable is set correctly when the value received is lower than the gauge's upper limit. Is there another way to change the upper limit of the gauge at runtime so that it always exceeds the current value of the gauge?
  4. Iam facing an issue for Dual Yaxis chart while rendering as "flash". For the same xml, chart is rendered in different way when is use setCurrentRenderer('flash') and setCurrentRenderer('javascript'). Here is my Xml: ------------------ <chart canvasbgAlpha="0" formatNumberScale="1" sFormatNumberScale="1" sNumberPrefix="$" borderThickness="0" chartLeftMargin="0" chartRightMargin="0" plotSpacePercent="65" showLegend="1" borderColor="FFFFFF" bgcolor="FFFFFF" bgalpha="0,0" legendBorderColor="FFFFFF" legendBgColor="FFFFFF" animation="1" legendShadow="0" showShadow="0" caption="" xaxisname="" decimals="1" numberPrefix="" numberSuffix="" sNumberSuffix="" showPlotBorder="0" showAlternateHGridColor="0" plotgradientcolor="" SyAxisMinValue="0" SyAxisMaxValue="200" PyAxisMinValue="0" PyAxisMaxValue="0" exportCallback="FC_Exported" exportEnabled="1" exportAtClient="0" exportAction="save" exportHandler="http://localhost/app/FCExporter.jsp" exportShowMenuItem="0" showExportDialog="0">, <categories>, <category label="2005"/>, <category label="2006"/>, <category label="2007"/>, <category label="2008"/>, <category label="2009"/>, </categories>, <dataset parentYAxis='S' renderAs='COLUMN' color="E0A9A8" showValues="0">, <set />,<set />,<set />,<set />, <set value="2816130"/>, </dataset>, <dataset parentYAxis='S' renderAs='LINE' dashed="1" lineDashLen="5" lineDashGap= "6" showValues="0" anchorSides="4" showAnchors="1" anchorRadius="1" anchorBgColor="C0504D" lineThickness="3" color="C0504D" >, <set />,<set />,<set />,<set />, <set value="2816130"/>, </dataset>, <styles><definition>, <style name='myFont' type='font' color='000000' bold='1'/></definition> <application>,<apply toObject='legend' styles='myFont'/></application>, </styles>, </chart> Please find the attached images when rendered as javscript and flash
  5. I cannot get LogMSColumn2D. swf javascript chart in PhP to display the category dates on X-Axis. The feature works fine in non-logarithmic Column2D For the regular I am using : $date = date("D (jS)",strtotime($ors[0])) ; $strXML .= "<set label='".$date."' value='".$ors[1]."' color='00FF00'/>"; $strXML .= ""; For the LogMSColumn2D ( to get chart to display) I am using: $date .= date("D (jS)",strtotime($ors[0])) ; $strXML.="<categories> <category label='".$date."'/>"; $strXML.="</categories>"; $strXML.="<dataset> <set value='".$ors[1]."' color='00FF00'/>"; $strXML.="</dataset>"; $strXML .= ""; What am I missing?
  6. Hi, I have a number of piecharts whose sources are in seperate xml files and loaded via the FusionCharts method. I.e. var myChart = new FusionCharts( {swfUrl:"Pie2D.swf", id : "FusionCharts_1", width: 450, height: 300, renderAt: "chartdiv", dataSource : "data/Overv_T1_Executed_payments_en.xml", dataFormat: 'xmlurl' }) I also have a Javascript JSON object "piechartSettings" containing some settings that I wish to apply to each and every pie chart. var piechartSettings = { baseFontSize : 11, baseFont:'Verdana', bgColor: 'Transparent', bgAlpha: 0, showBorder:0, use3dlighting: "0", showshadow: "0", manageLabelOverflow: 1, showLegend: 1, showLabels:0, chartType:"pie", chartDim:"2D" } How can I update the chart data with this JSON object BEFORE the chart renders, so that all my charts have the same look and fell without having to resort to adding these parameters to each and every single xml file. I have tried setChartAttribute method, both before and after the render() method, but this does not result in anything. I have also tried it using the "Loaded" event, but this stilml results in a short flash rendering of the previous chart style: myChart.addEventListener('Loaded',function(eventObject,argumentsObject ){ myChart.setChartAttribute(piechartSettings) }) Does anyone have any experience doing this? A simple and effective way of controlling all charts look and feels with a single object? Thanks in advance, Björn (Belgium)
  7. Hello, I have a website that's been using FusionCharts for a while without any issues. But now I just realized that with IE11, the export functions I have built are no longer working. The printing and exporting works fine in all other version of IE, Firefox and Chrome, and even on IE11 when compatibility view is turned ON. I'm building the chart server-side like this: Dim chartHtml = FusionCharts.RenderChartHTML("Charts/FusionCharts/ScrollColumn2D.swf?registerWithJS=1", "", xml.ToString(), "MyChart", "100%", "350", False, True, True) I've noticed that when on IE10 or IE11 compatibility view, this renders an <object> element, but on IE11 it creates an <embed> element. And then the javascript functions I've been using are these: function printChart() { var chartToPrint = document.getElementById('MyChart'); chartToPrint.print(); } function ExportMyChartPDF() { var chartObject = document.getElementById('MyChart'); if (chartObject.hasRendered()) chartObject.exportChart({ exportFormat: 'PDF' }); } function ExportMyChartJPG() { var chartObject = document.getElementById('MyChart'); if (chartObject.hasRendered()) chartObject.exportChart({ exportFormat: 'JPG' }); } These functions throws errors saying the object does not support the "print" method, or the "hasRendered". "Object doesn't support this property or method" Do you know why is this happenning and if there's a way to fix it? Thanks.
  8. I am having difficulty exporting a pure JavaScript chart from the basic examples provided in the C# solution (demo package from fusion charts). My sample is from the evaluation code provided on the FusionChart website. I have added exportenabled='1' exportHandler='http://localhost:64162/CS/Export_Handler/FCExporter.aspx' to the existing Data.xml file in order to enable export using the local handler Chart definition for the chart BasicExample/MultiChartsJS.aspx: <chart caption='Monthly Unit Sales' xAxisName='Month' yAxisName='Units' showValues='0' formatNumberScale='0' showBorder='1' exportenabled='1' exportHandler='http://localhost:64162/CS/Export_Handler/FCExporter.aspx'> <set label='Jan' value='462' /> <set label='Feb' value='857' /> <set label='Mar' value='671' /> <set label='Apr' value='494' /> <set label='May' value='761' /> <set label='Jun' value='960' /> <set label='Jul' value='629' /> <set label='Aug' value='622' /> <set label='Sep' value='376' /> <set label='Oct' value='494' /> <set label='Nov' value='761' /> <set label='Dec' value='960' /> </chart> I am pointing the exportHandler to the C# export handler (FCExporter) found in the same solution. When invoking the export, the handler fires, but I am encountering two different runtime errors in the handler: Failures inside FCExporter.cs 1)Jpeg conversion: gr.Clear(ColorTranslator.FromHtml("#" + rawImageData["bgcolor"].ToString())); is failing because rawImageData["bgcolor"] already contains a # 2)PDF conversion int fRepeat = int.Parse(split_data[1]); is failing with an out of range exception It almost seems like the handler is out of sync with the charts that are being exported. It works if I point to the external fusion site for the export. Is there a new version of the handler available? I am using FusionCharts XT Version: 3.3.1. Thanks, Bhushan
  9. hello, I have a series of webpages that use RealTimeArea.swf to graph the number of calls coming in. We have been trying to move over to using the Javascript (HTML5) rendering engine, so that more browsers can show the graphs for our clients, but we still have to support IE8 and 9. I have enclosed the code that is used to create and give the chart some data. it is the same for all instances of our web page. we use: <script type=""text/javascript"">FusionCharts.setCurrentRenderer('javascript');</script> when we want the charts to be forced over to javascript rendering. The issue we are having is that the category labels on the x-axis are not always showing. I can see in the data that I have them, but the HTML5 renderer does not show them. The flash version does. any ideas why? thanks Geordi fusion chart code.txt
  10. Hello, I am still in FusionCharts evaluation mode, and I face a problem when use the FusionCharts with Javascript option, the charts hide the drop-down menu as the screenshot below! Chart on left source code is: FusionCharts.SetRenderer("javascript") chart_from_db1.Text = FusionCharts.RenderChart("FusionCharts/Line.swf", "", xmlStr.ToString(), "a", "500", "250", False, True) Chart on right source code is: chart_from_db2.Text = FusionCharts.RenderChart("FusionCharts/Line.swf", "", xmlStr1.ToString(), "b", "420", "250", False, True, True) I am using FusionCharts with VB ASP .NET Regards,
  11. Chart not supported error

    Hi, I am using fusion charts XT javascript charts. Consider the following situation - I have created Pie Chart and I have facility to edit that chart and select different chart types. While I switch between different chart types, It works perfectly as I want, but while ajax call is fetching the data, it shows the error "Chart type not supported with fusion charts logo below it". Following is the code I user to switch between the charts - var chartObject1 = FusionCharts("fu-chart-<?php echo $model->id ?>"); //if chart is already created, then dispose it if(chartObject1 != null) chartObject1.dispose(); //create the chart dynamically with chart type chartType var myChart = new FusionCharts( chartType, "fu-chart-<?php echo $model->id ?>", "100%", "100%"); var chartDataUrl = "path/to/url"; myChart.setXMLUrl(chartDataUrl); myChart.render("chartdiv-<?php echo $canvasItem->id ?>");
  12. hello, I need to somehow get the information from one point of my chart by javascript, I need the information about the category, series name and value to use in a javascript function. Currently inserted already own a javascript function on my link properties however I could not find it through the DOM. My goal is to find the object on the screen through the information they already have in my application for example: get the point of my line chart que have the value 7, category '12: 00 ', and series-name' test 'for that in some cases I will be able to add a popover on the circle, rect or other object that has the specific values​​. Can anyone help me???
  13. Hi.. I am using fusion chart server side export. I have done it as explained in this tutorial. It is working on IE8,IE9,IE10, Chrome and Mozilla. BUT it has problem with IE11. I have checked by debugging and found that I am getting objRtn.statusCode 0 after chart export in FC_Exported function. Is that IE11 issue and if yes what is the solution ? Thanks in advance
  14. I recently upgraded from FusionCharts 3.2.1 to XT. I followed the instructions here, including the instructions relate to FusionWidgets: http://docs.fusioncharts.com/charts/contents/Introduction/Upgrading32.html and am using the following line to render JS charts by default: FusionCharts.setCurrentRenderer('javascript'); Previously, our system was set up to render Flash charts from XML data, and I haven't changed any of the existing code. I'm now seeing the following error in the console, on a page that renders a number of angular gauges: Uncaught ReferenceError: parseTooltext is not defined FusionCharts.HC.Widgets.js:193 p.series FusionCharts.HC.Widgets.js:193 p.chart FusionCharts.HC.Widgets.js:120 R.init FusionCharts.HC.js:521 p.init FusionCharts.HC.Widgets.js:105 g.createChart FusionCharts.HC.js:460 j.extend.render FusionCharts.HC.js:782 a.renderer.render FusionCharts.js:56 a.extend.render FusionCharts.js:64 dash.renderXML dashboard.js:40 (anonymous function) dashboard.js:227 c jquery-1.10.2.js:3048 p.fireWith jquery-1.10.2.js:3160 k jquery-1.10.2.js:8235 r jquery-1.10.2.js:8778 dash.renderXML (dashboard.js, line 40) calls chart.setDataXml() with the following xml: <?xml version="1.0" encoding="utf-8"?> <chart showLimits="0" showAboutMenuItem="0" chartRightMargin="8" lowerLimit="-100" clickURL="JavaScript:dash.change_metric(0);" gaugeEndAngle="0" tickValueStep="1" bgColor="ffffff" tickValueDistance="14" autoScale="0" palette="1" gaugeStartAngle="180" showTickValues="1" chartTopMargin="5" exportEnabled="1" chartLeftMargin="8" chartBottomMargin="5" showBorder="0" imageSaveURL="/data/image" exportFormats="PNG=Save as Image" decimals="1" showTickMarks="1" upperLimit="100"> <colorRange> <color code="FFFFFF" maxValue="-15.6" minValue="-100.0"/> <color code="FF0000" maxValue="1.7" minValue="-15.6"/> <color code="f2f20c" maxValue="14.5" minValue="1.7"/> <color code="0cf20c" maxValue="62.2" minValue="14.5"/> <color code="FFFFFF" maxValue="100.0" minValue="62.2"/> </colorRange> <dials> <dial rearExtension="5" toolText="Amazon.com: 62.2" id="brand1" value="62.2"/> </dials> <trendpoints> <point color="666666" alpha="100" thickness="2" startValue="7.21319806914" displayValue=" "/> </trendpoints> <styles> <definition> <style bgColor="ffffff" type="font" name="defaultfont"/> </definition> <application> <apply toObject="value" styles="defaultfont"/> <apply toObject="limitvalues" styles="defaultfont"/> </application> </styles> </chart> dashboard.js, line 227 is the line that calls this function. The gauges are not being rendered; they just show up as blank boxes. Any idea where this error might be coming from or how to fix it? Thanks!
  15. Javascript Fallback Problems

    Hello. I am having problems with the Javascript charts rendering when flash is unavailable. What I get right now is an X in the frame where the chart is supposed to be. The same chart renders perfectly using flash. The same chart also renders when I FusionCharts.setCurrentRenderer("javascript"); My company likes the look and speed of the flash version, but not all of our computers/devices are flash capable. I've done a little bit of research and I am fairly certain that what I read said that this feature is in the FusionCharts.js file so then I did <script type="text/javascript" charset="utf-8" src="js/fusioncharts/Charts/FusionCharts.js"></script> Making sure that: FusionCharts.HC.Charts.js FusionCharts.HC.js and jquery.min.js are in the same folder as FusionCharts.js Which still didn't work. I am operating Internet Explorer 9 and have tried in Firefox and Chrome with the same failures. I am using FusionCharts 3.3.1 XT I don't think it matters but I am using a realtimeline graph. Am I missing something? Thanks.
  16. Hello, I have a MSLine chart using validated JSON. This works fine using the flash but when I try to render it in javascript it errors. If I use myChart.setJSONUrl("ReceiptsMSLine.json"); I get invalid data error If i use myChart.setJSONData('MyJson'); I get the error: Line: 15 Error: Unable to get value of the property 'split': object is null or undefined Any help would be greatly appreciated. code is below: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Financial Chart</title> <script src="../../Charts/FusionCharts_EnterpriseEx/Charts/FusionCharts.js" type="text/javascript"></script> <script src="../../Charts/FusionCharts_EnterpriseEx/Charts/jquery.min.js" type="text/javascript"></script> <script src="../../Charts/FusionCharts_EnterpriseEx/Charts/highcharts.js" type="text/javascript"></script>   </head> <body> <div id="wrapper">   <div id="chartContainer">FusionCharts will load here</div> <script type="text/javascript"><!-- FusionCharts.setCurrentRenderer('javascript'); var myChart = new FusionCharts("../../Charts/FusionCharts_EnterpriseEx/Charts/MSLine.swf", "ChartId", "800", "500", "0", "0"); //myChart.setJSONUrl("ReceiptsMSLine.json"); myChart.setJSONData('{"chart":{ "caption":"Receipts - cumulative", "xaxisname":"Month", "yaxisname":"Receipts £", "showvalues":"0", "numberprefix": "%A3", "bgColor":"ffffff", "showBorder":"0","numVDivLines":"10","reverseLegend":"1"},"categories":[{"category":[{"label":"Apr"},{"label":"May"},{"label":"Jun"},{"label":"Jul"},{"label":"Aug"},{"label":"Sep"},{"label":"Oct"},{"label":"Nov"},{"label":"Dec"},{"label":"Jan"},{"label":"Feb"},{"label":"Mar"}]}],"dataset":[{"seriesname":"Monthly Plan","color": "af292e","data":[{"value":"9378010"},{"value":"71026533"},{"value":"90101266"},{"value":"97825351"},{"value":"103616222"},{"value":"117813441"},{"value":"128052071"},{"value":"136053732"},{"value":"149482740"},{"value":"156552766"},{"value":"162577528"},{"value":"313978555"}]},{"seriesname":"DEL Forecast","color":"00857e","dashed":"1","data":[{"value":""},{"value":""},{"value":""},{"value":""},{"value":""},{"value":""},{"value":""},{"value":""},{"value":"211006263"},{"value":"230506969"},{"value":"247861703"},{"value":"324894030"}]},{"seriesname":"Actual YTD","color":"00857e","data":[{"value":"8305075"},{"value":"69262137"},{"value":"84307885"},{"value":"99994631"},{"value":"119527041"},{"value":"142661942"},{"value":"160449790"},{"value":"180489689"},{"value":"211006263"},{"value":""},{"value":""},{"value":""}]}],"styles":[{"definition":[{"style":[{"name":"CanvasAnim","type":"animation","param":"_xScale","start":"0","duration":"1"}]}],"application":[{"apply":[{"toobject":"Canvas","styles":"CanvasAnim"}]}]}]}'); myChart.render("chartContainer" ); </script> </div> </body> </html>
  17. I have fusioncharts in javascript (not flash) exporting via each of the four file types properly but I want to restrict the user to only 'PDF'. Is there a way to do that? I tried setting the 'exportfileformat' attribute to PDF but that didn't work. Also is there a way to easily reposition the export button on the javascript fusioncharts from the top right to say the bottom right? Thanks!
  18. Hi, I´m using the same code to render a Pie Chart using Flash and using Javascript (the only difference is "FusionCharts.setCurrentRenderer('javascript');}" to force Javascript), but I´m getting different results. The Flash Chart shows exactly what I want, but the Javascript Chart doesn't show percentage in labels, as shown in images. The showPercentageInLabel='1' doesn't work in Javascript? Tks! code: <script type="text/javascript"> var myChart = new FusionCharts( "../../FusionCharts/Pie2D.swf", "myChartId1", "240", "240", "0", "1" ); myChart.setXMLUrl("../data/data.xml"); myChart.render("top5_pizza"); </script> data.xml: <chart animation='0' caption='Entradas' subcaption='Referenciado: 172' pieRadius='55' showPercentInToolTip='0' decimals='0' forceDecimals='0' decimalSeparator=',' thousandSeparator='.' slicingDistance='8' showPercentageInLabel='1' formatNumberScale='0' showValues='1' showLabels='0' bgColor='FFFFFF' showBorder='0' startingAngle='90' showLegend='1' legendShadow = '0' legendBorderColor = 'ffffff' smartLineColor = 'ffffff'> <set label='Outros' value='72' color='E3E3E3' /> <set label='Referenciado' value='100' color='043C6B' isSliced = '1' /> </chart>
  19. 3D Area Chart

    When rendering the True 3D Area Chart(MSCombi3D.swf) with JavaScript, the result is in 2D instead of 3D. Also there are some differences when rendering 3D charts with Flash and JavaScript. Why this problem occur? and How can I fix this? (3D Column produces same result with Flash and JavaScript rendering) -Attached is a document with image captures.
  20. Hello, I programmed an html page with a map of Spain with provinces (see attached files - please add the fusion map libraries). The render mode is javascript and I want to show a value for each province in the map. As indicated in docs.fusioncharts.com/maps/Contents/MapSS/SpainProvinces.html, there is 52 provinces, so the xml will have a maximum of 52 provinces. As we want to show a value in each province, we will have a xml with 52 entities (see attached file). It happens somewhat the reported in this topic: forum.fusioncharts.com/topic/13835-worldwithcountries-render-mode-javascript-bug/ With 51 entities it is shown correctly in the map - except for one province, the province I comment. With 52 entities, the first entity of the xml is not shown (Albacete is this case), but the rest is ok. With 53 entities, the second entity of the xml is not shown, but the rest is ok. It seems like this map admits only 51 entities in the xml, but the number of provinces is 52. Is this a bug or I'm missing something? Thank you very much John fm.html
  21. MSLine2D not rendering

    Hi everybody, I try to render a multi series line chart in my page, using 3 php files : - index.php, wich contains a form to pick up some elements (processes executed in the month, and a period -last hour, last day..), - processCharts.php, which treat the informations from the form and call the function "renderchartAvgSum(()" - chartCreation.php, in which i defined the function "renderchartAvgSum()" and which uses "renderChartJS()" from FusionChart. let's see this : chartCreation.php <?php require_once("/FusionChartPath/FusionCharts_Gen.php"); /* function renderchartAvgSum() : * $chartType : the Chart we want to build. MSLine, Line etc... * $pID : lists of process Ids to find in the database * $step : step of xAxis in the cahrt * $diffDate : difference in days between $endDate -today- and begin date of process * $endDate : ending date of process . generally = SYSDATE * $queryValue : what we need (avg by wich time?) * $graphW, $graphH : dimensions of chart. */ renderchartAvgSum($chartType,$pID,$step, $diffDate, $endDate, $chartName, $queryValue, $graphW, $graphH){ if(!empty($processList)){ } ?> blabalaaa
  22. MSLine2D not rendering

    Hi everybody, I try to render a multi series line chart in my page, using 3 php files : - index.php, wich contains a form to pick up some elements (processes executed in the month, and a period -last hour, last day..), - processCharts.php, which treat the informations from the form and call the function "renderchartAvgSum(()" - chartCreation.php, in which i defined the function "renderchartAvgSum()" and which uses "renderChartJS()" from FusionChart. let's see this : chartCreation.php <?php require_once("/FusionChartPath/FusionCharts_Gen.php"); /* function renderchartAvgSum() : * $chartType : the Chart we want to build. MSLine, Line etc... * $pID : lists of process Ids to find in the database * $step : step of xAxis in the cahrt * $diffDate : difference in days between $endDate -today- and begin date of process * $endDate : ending date of process . generally = SYSDATE * $queryValue : what we need (avg by wich time?) * $graphW, $graphH : dimensions of chart. */ renderchartAvgSum($chartType,$pID,$step, $diffDate, $endDate, $chartName, $queryValue, $graphW, $graphH){ if(!empty($processList)){ } ?>
  23. Hi, I am using FusionWidgets XT (v3.3.1 - Service Release 2) (28th May, 2013) with Ruby on Rails version 3.0.19, Ruby version 1.9.2-p290 (for more details, please reference forum topic: http://forum.fusioncharts.com/topic/15081-server-side-export-javascript-rendered-gantt/) When i try to export a javascript Gantt chart, the SVG sent back to the server has zero-width task bars. So when I transcode the SVG to PNG using Batik, the task bars are missing from the rendered image. These are the attributes for my chart. Note that I must set taskBarFillMix to an empty string so that Batik does not choke on gradients. <chart dateFormat="yyyy/mm/dd" outputDateFormat="mm/dd/yyyy" showTaskLabels="0" showPercentLabel="0" showSlackAsFill="0" useVerticalScrolling="1" manageResize="1" animation="1" exportEnabled="1" exportShowMenuItem="0" exportHandler="/downloads/gantt" html5ExportHandler="/downloads/gantt" taskBarFillMix="" taskBarFillRatio=""> attributes for my task bars <task start="#{start_date}", end="#{end_date}" label="#{task_name}" color="#b2c8d9" processId="#{proc_name}" link="#{task_url}" Some of my gantt charts have grouped tasks and those attributes are <task start="#{start_date}" end=>"#{end_date}" label="#{group_name}" color="#000000" processId="#{proc_name}" showAsGroup=1 showLabel=0 topPadding="70%" showStartDate=1 showEndDate=1 /> Ruby on Rails controller class DownloadsController < ApplicationController def gantt # grab only SVG. Drill down charts may wrap SVG in HTML svg_match = params[:stream].to_s.match(/<svg.*<\/svg>/) svg_text = svg_match[0] rescue params[:stream].to_s # fix invalid attribute values coming from FusionChart SVG svg_text.gsub!(/text-anchor=\"undefined\"/, "text-anchor='start'") svg_text.gsub!(/shape-rendering=\"default\"/, "shape-rendering='auto'") svg_text.gsub!(/visibility=\"\"/, "visibility='inherit'") # write sanitized SVG to temp file tempfile = Tempfile.new( ActiveSupport::SecureRandom.hex(16) ) tempfile.write(svg_text) # SVG to PNG using Batik output_name = Rails.root.join( "public", "exports", "gantt.png") width = svg_text.match(/width=\"[\d]+\"/)[0].match(/[\d]+/)[0].to_i exec_str = "java -jar #{batik_path} -m image/png -d #{output_name} -w #{width} #{tempfile.path}" return_val = system( exec_str ) end end However, this fails to produce a useful PNG Gantt chart. The task bars are missing even though the Gantt chart in the client web browser looks perfect. After some digging through the SVG itself, I found that the SVG returned from the chart on the client browser has zero-width task bars. <rect x=\"2041.5\" y=\"163.5\" width=\"0\" height=\"9\" r=\"0\" rx=\"0\" ry=\"0\" fill=\"#b2c8d9\" stroke=\"#999999\" fill-opacity=\"1\" stroke-opacity=\"1\" stroke-width=\"1\" style=\"cursor: pointer;\"></rect> <rect x=\"2243.5\" y=\"187.5\" width=\"0\" height=\"9\" r=\"0\" rx=\"0\" ry=\"0\" fill=\"#b2c8d9\" stroke=\"#999999\" fill-opacity=\"1\" stroke-opacity=\"1\" stroke-width=\"1\" style=\"cursor: pointer;\"></rect> <rect x=\"2243.5\" y=\"211.5\" width=\"0\" height=\"9\" r=\"0\" rx=\"0\" ry=\"0\" fill=\"#b2c8d9\" stroke=\"#999999\" fill-opacity=\"1\" stroke-opacity=\"1\" stroke-width=\"1\" style=\"cursor: pointer;\"></rect> <rect x=\"2243.5\" y=\"235.5\" width=\"0\" height=\"9\" r=\"0\" rx=\"0\" ry=\"0\" fill=\"#b2c8d9\" stroke=\"#999999\" fill-opacity=\"1\" stroke-opacity=\"1\" stroke-width=\"1\" style=\"cursor: pointer;\"></rect> <rect x=\"2243.5\" y=\"259.5\" width=\"0\" height=\"9\" r=\"0\" rx=\"0\" ry=\"0\" fill=\"#b2c8d9\" stroke=\"#999999\" fill-opacity=\"1\" stroke-opacity=\"1\" stroke-width=\"1\" style=\"cursor: pointer;\"></rect> <rect x=\"2243.5\" y=\"283.5\" width=\"0\" height=\"9\" r=\"0\" rx=\"0\" ry=\"0\" fill=\"#b2c8d9\" stroke=\"#999999\" fill-opacity=\"1\" stroke-opacity=\"1\" stroke-width=\"1\" style=\"cursor: pointer;\"></rect> <rect x=\"2243.5\" y=\"307.5\" width=\"0\" height=\"9\" r=\"0\" rx=\"0\" ry=\"0\" fill=\"#b2c8d9\" stroke=\"#999999\" fill-opacity=\"1\" stroke-opacity=\"1\" stroke-width=\"1\" style=\"cursor: pointer;\"></rect> Also, the "r" attribute does not seem to mean anything for the rect element according the Mozilla Developer Network: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/r and https://developer.mozilla.org/en-US/docs/Web/SVG/Element/rect. (for more details, please reference forum topic: http://forum.fusioncharts.com/topic/15081-server-side-export-javascript-rendered-gantt/) I have attached the what the Gantt chart looks like in the web browser. The blue task bars and the black grouped task bar are missing when i export to PNG.
  24. Hi I am using pure Javascript (renderer = javascript) Gantt chart in Ruby On Rails (version 3.0.19). It looks fine in web browser. Now i want to export but i didn't want to use php on my Ruby on Rails server as instructed on this page: http://docs.fusioncharts.com/widgets/Contents/ExportingImage/ECPureJS.html Instead, from my Rails controller I pull in the SVG from the return parameters (i.e. params[:stream]) and pass it to batik to convert into png file as follows ruby on rails controller code: svg_match = params[:stream].to_s.match(/<svg.*<\/svg>/) svg_text = svg_match[0] rescue params[:stream].to_s tempfile = Tempfile.new( ActiveSupport::SecureRandom.hex(16) ) tempfile.write(svg_text) output_name = Rails.root.join( "public", "exports", "gantt.png") exec_str = "java -jar #{batik_path} -m image/png -d #{output_name} #{width} #{tempfile.path}" return_val = system( exec_str ) Everything looks good except that my task bars are missing! Process names show up on the left, dates show up on the top, and even the grid background of the gantt shows up. But there no task bars. What might I be doing wrong? As a second question, didn't the returned SVG on an export used to be in a parameter called "svg" as in params[:svg]? I am using version FusionWidgets XT (v3.3.1 - Service Release 2) (28th May, 2013) NOTE: In order for Batik to not choke on the gantt chart SVG I had to disable gradients on the task bars as follows <chart plotGradientColor='' taskBarFillMix='' ...>
  25. Hi, I am using FusionCharts version 3.3.1 and trying to export charts as images/pdfs using J2EE export handler. Everything works fine when I use Flash version of chart and export images. When I disable Flash in browser, JS chart is rendered and I am getting "Insufficient Data" error via FC_Exported(objRtn) javascript callback function. Here are Tomcat server logs: Aug 20, 2013 1:23:04 PM com.fusioncharts.exporter.error.ErrorHandler buildResponse INFO: Miscellaneous Messages=&width=0&height=0&DOMId=Chart_ID_0.9248934648931026 Here is my config: JSP/HTML code for chart <chart bgAlpha='0,0' enableSmartLabels='1' pieRadius='120' formatNumberScale='0' debug='true' exportEnabled='1' registerWithJS='true' exportCallback='FC_Exported' exportHandler='/res/FCExporter' exportAtClient='0' exportAction='save' bgColor='F7F7F7' showBorder='0' showShadow='0' use3DLighting='0'> fusioncharts_export.properties under classes folder SAVEPATH=/usr/sites/host101.com/htdocs/graphs HTTP_URI=http://host101.com/graphs/ OVERWRITEFILE=false INTELLIGENTFILENAMING=true FILESUFFIXFORMAT=TIMESTAMP Can anyone please help? Thank you in advance.