Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Problem with HTMLFlow and Fusion Charts

    Greetings,

    Using 7.0rc2. I'm not using the fusion chart features of smartclient yet. That will come in a later release. We're also using HTMLFlow to display some reports, we won't be updating those reports to use SC until a later phase.

    So I setcontent on the HTMLFlow to display the HTML report. Works fine. However, some reports contain fusion charts. The chart works fine on Chrome. It appears for few seconds on Firefox and then disappears (as if overwritten or erased after display). It does not work on IE. I'm not seeing any obvious messages in the console. The chart is setup using javascript. Is there a problem with passing fusioncharts into an HTMLFlow?

    Code:
    isc.HTMLFlow.create({
        width:"100%",
        height:"100%",
        autoFit:true,
        allowCaching:false,
        ID:"contentPaneHTML",
        contents:"",
        autoDraw:false
    });
    Here is the javascript for the chart:
    Code:
        	<script>
                  var chartAtts = {
                  formatNumberScale:'0',
                  showPercentValues:'1',
                  decimals:'0',
                  enableRotation:'0',
                  pieSliceDepth:'30',
                  isSmartLineSlanted:'0',
                  showPercentInToolTip:'1',
                  pieYScale:'30',
                  pieRadius:'100',
                  plotFillAlpha:'80',
                  pieInnerfaceAlpha:'60',
                  slicingDistance:'35',
                  startingAngle:'190',
                  enableSmartLabels:'0',
                  baseFont:'Arial',
                  baseFontSize:'10',
                  baseFontColor:'660000'
                  };
                  var lbl1 = escape('-');
                  var lbl2 = escape('-');
                  var lbl3 = escape('-');
                  var lblo = escape('Other');
                  var lob1 = 0;
                  var lob2 = 0;
                  var lob3 = 0;
                  var lobo = 0;
                  if (lob1 + lob2 + lob3 + lobo == 0) {
    	              lblo = 'No NPW';
    	              lobo = '100';
                  }
                  var chrt1 = {label:lbl1,value:escape(lob1),isSliced:'0',color:'FFFF99'};
                  var chrt2 = {label:lbl2,value:escape(lob2),isSliced:'0',color:'00CC00'};
                  var chrt3 = {label:lbl3,value:escape(lob3),isSliced:'0',color:'BFCFFF'};
                  var chrt4 = {label:lblo,value:escape(lobo),isSliced:'0',color:'AA80FF'};
                  var captionStyle = {type:'font',name:'CaptionFont',color:'660000',size:'11',bold:'0'};
                  var toolTipStyle = {type:'font',name:'ToolTipFont',borderColor:'7f7f7f',color:'000066',bgColor:'99CCFF',size:'11',bold:'0'};
                  var labelStyle = {type:'font',name:'LabelFont',color:'000066',size:'11',bold:'1', labelDisplay:'STAGGER'};
                  var captionApply = {toObject:'caption',styles:'CaptionFont'};
                  var toolTipApply = {toObject:'toolTip',styles:'ToolTipFont'};
                  var labelApply = {toObject:'DataLabels',styles:'labelFont'};
    
                  var chart1 = new FusionCharts('/iap/docs/iap/images/fusioncharts/Pie3D.swf', 'netPremWritten', '370', '200', '0', '3');
                  var results = [ ];
                  results.push(element('chart','open',chartAtts));
                  results.push(element('set','',chrt1));
                  results.push(element('set','',chrt2));
                  results.push(element('set','',chrt3));
                  results.push(element('set','',chrt4));
                  results.push(element('styles','open'));
                  results.push(element('definition','open'));
                  results.push(element('style','',captionStyle));
                  results.push(element('style','',toolTipStyle));
                  results.push(element('style','',labelStyle));
                  results.push(element('definition','close'));
                  results.push(element('application','open'));
                  results.push(element('apply','',captionApply));
                  results.push(element('apply','',toolTipApply));
                  results.push(element('apply','',labelApply));
                  results.push(element('application','close'));
                  results.push(element('styles','close'));
                  results.push(element('chart','close'));
                  chart1.setDataXML(results.join(' '));
                  chart1.render('chartdiv');
    
                   var chart1 = new FusionCharts('/iap/docs/iap/images/fusioncharts/Pie3D.swf', 'netPremWritten', '370', '200', '0', '3');

    #2
    What HTMLFlow is giving you is just the ability to insert some HTML into the DOM. Browsers behave differently when that HTML contains embedded SCRIPT blocks - some execute, some don't, in some the timing of the execution is different that during a normal page load.

    We'd recommend taking another approach if possible, otherwise, either loading the fragment as an IFrame (contentsType:"page") or pre-processing the HTML and inserting it in chunks, while using eval() to run the JavaScript.

    Comment


      #3
      We'll give it a shot, thanks.

      Comment

      Working...
      X