safadig

Members
  • Content count

    39
  • Joined

  • Last visited

Posts posted by safadig


  1. Adding the <axis> as strXML prevents the chart from Rendering. 

    $strXML .="<axis title='item 2014' tickwidth='10' divlinedashed='1'>";
    	$strXML .="<dataset seriesName='item 2014' >";
    	 if ($result2) {
              while($ors1 = mysql_fetch_array($result2)) {
               $strXML .= "<set   value='".$ors1['item']."' />";
             }
         }
    	 $strXML .= "</dataset>";
    	 $strXML .="</axis>";
    	 
    	 $strXML .="<axis title='item 2015' tickwidth='10' divlinedashed='1'>";
    	 $result3 = mysql_query($strQuery15) or die(mysql_error());
    	 $strXML .="<dataset seriesName='item 2015'>";
    	 if ($result3) {
             while($ors1 = mysql_fetch_array($result3)) {
              $strXML .= "<set   value='".$ors1['item']."' />";
             }
        }
    	$strXML .= "</dataset>";
    	$strXML .="</axis>";
    	
    	
    	 $strXML .="<axis title='item 2016' numdivlines='10' tickwidth='10' divlinedashed='1'>";
    	 $result4 = mysql_query($strQuery16) or die(mysql_error());
    	 $strXML .="<dataset seriesName='item 2016'>";
    	 if ($result4) {
             while($ors1 = mysql_fetch_array($result4)) {
              $strXML .= "<set   value='".$ors1['item']."' />";
             }
        }
    	 
    	  
    	 	 
               mysql_close($link);
    		   
    		   
               $strXML .= "</dataset></axis>";
    

  2. I am having problem with the Text Annotations  shifting right vs the gauge when the chart is rotated on device from portrait to landscape. I am running 3.6.0

     

    Thanks for the help..

     


    var gauge = {


        "type": "angulargauge",


        "renderAt": "container",


        "width": '100%',


        "height": 195,


        "dataFormat": "json",


        "dataSource": {


            "chart": {


                "id": 'myChartId',


                "exportEnabled": "0",


                "manageResize": "1",


                "bgColor": "#ffffff",


                "bgAlpha": "0",


                "outCnvbaseFontSize": "18",


                "outCnvbaseFontColor": "074A09",


                "upperLimit": "130",


                "lowerLimit": "0",


                "showLimits": "0",


                "lowerLimitDisplay": "",


                "upperLimitDisplay": "",


                "gaugeStartAngle": "180",


                "gaugeEndAngle": "0",


                //"bgImage": "Ragweed.jpg",


                "bgImageAlpha": "55",


                "bgImageDisplayMode": "fit",


                "gaugeFillMix": "{light-10},{light-20},{light-60},{dark-30},{dark-40}, {dark-40}",


                "gaugefillpattern": "linear",


                "gaugeBorderColor": "{dark-30}",


                "gaugeOuterRadius": "75",


                "gaugeInnerRadius": "50",


                "pivotRadius": "10",


                "showValue": "0",


                "tickValueStep": "5",


                "placeValuesInside": "1",


                "borderAlpha": "0",


                "canvasBorderAlpha": "0"


            },


            "colorRange": {


                "color": [{


                    "minValue": "0",


                    "maxValue": "15",


                    "code": "#96C900"


                }, {


                    "minValue": "15",


                    "maxValue": "65",


                    "code": "#FFFB14"


                }, {


                    "minValue": "65",


                    "maxValue": "130",


                    "code": "#C90000"


                }]


            },


            "dials": {


                "dial": [{


                    "value": "0",


                    "tooltext": "Latest count",


                    "rearExtension": "15",


                    "radius": "66",


                    "baseWidth": "12",


                    "topWidth": "3",


                    "bgColor": "210B02"


                }]


            },


            "annotations": {


                "groups": [{


                    "id": "Grp1",


                    "x": "160",


                    "y": "172",


                    "autoscale": "1",


                    "scaleText":"1",


                    "showBelow": "1",


                    "alpha": "50",


                    "items": [


                    /*


                    {


                        "type": "arc",


                        "startAngle": "0",


                        "endAngle": "180",


                        "Alpha": "100",


                        "Color": "678000,FCEF27,E00000",


                        "fillpattern": "linear",


                        "fillratio": "25,35,40",


                        "showborder": "0",


                        "radius": "51",


                        "innerradius": "47"


                    }*/


                   ]


                }, {


                    "id": "Grp2",


                    "items": [{


                        "type": "text",


                        "label": "LOW",


                        "font": "Verdana",


                        "scaleText":"1",


                        "x": "55",


                        "y": "105",


                        "align": "left",


                        "vAlign": "left",


                        "fontcolor": "01701D",


                        "fontSize": "14",


                        "isBold": "1"


                    }]


                }, {


                    "id": "Grp3",


                    "items": [{


                        "type": "text",


                        "label": "HIGH",


                        "font": "Verdana",


                        "scaleText":"1",


                        "x": "216",


                        "y": "105",


                        "align": "left",


                        "vAlign": "left",


                        "fontcolor": "FF0000",


                        "fontSize": "14",


                        "isBold": "1"


                    }]


                }]


            }


        }


    };



  3. 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?


  4. How about any help for iOS?

     

    I have been trying to use a functional php Fusionchart from within a PhoneGap Build application but only get the chart div loading as 'Chart'

     

    These are the index.html scripts:

    <script src="js/jquery.js"></script>
        <script src="js/map.js"></script>
    <script src="js/jquery.mobile.min.js"></script>
    <script src="js/leaflet.js"></script>
    <script src="js/app.js"></script>
    <script src="phonegap.js"></script>
    <script src="childbrowser.js"></script>
                  <script type="text/javascript">
     
    $(document).ready(function() {
    });
     
    I tried loading with and without Fusioncharts scripts:
    <script src="js/FusionCharts.js"></script>
          <script src="js/FusionCharts.HC.js"></script>
    <script src="js/FusionCharts.HC.Charts.js"></script>
    <script src="js/FusionCharts.jqueryplugin.js"></script>

     

     

    But still either end with 'Chart' or '2014'

     

    It would be nice if there was a Phonegap build Plugin avaialbel for FusionCharts..

     

    Thanks


  5. I am having difficulty getting a chart to display for current date that I would select from an inline jquery Calendar. the Calendar has the behavior of posting the date when a date is selected; I am trying to use to posted date to select the data for that date to be plotted in the chart. when I select the date, my chart page opens but displays 'No data to display'. I spent hours but cannot find the reason..

    The Calendar File 'Popupdate.php'

    <FORM NAME='datecount' ACTION='popupchart.php' METHOD='POST'>
      <input name="currentdate" type="text" id="currentdate">
    </FORM>
     
    and the Popupchart file:
     
      <script type="text/javascript" src="../Fusion/Charts/FusionCharts.js"></script>
    <meta charset='utf-8'>
     <?php
      include("../includes/FusionCharts.php");
       include("../includes/FusionCharts_Gen.php");
       include("../includes/DBConn.php");
    $mydate=$_POST['currentdate'];
    $link = connectToDB();
     
     
    $strQuery ="SELECT * from Counts WHERE date ='" . $mydate . "' ";
    // Execute the query, or else return the error message.
    $result = mysql_query($strQuery) or die(mysql_error());
    $strXML = "<chart caption='Nortwest Ohio NAB Certified Pollen Count April/May 2014' subcaption='© 2014, Dr. Safadi & Associates, Inc. All rights reserved.'>";
     
    Thanks for the help
     
     
    // If we get a valid response - 
    if ($result) {
    while($row_strQuery = mysql_fetch_assoc($result))
    {
            $strXML .= "<set label='Trees' value='".$row_strQuery['trees']." color='00FF00'/>";
    $strXML .= "<set label='Grass' value='".$row_strQuery['grass']."' color='00FF00'/>";
    $strXML .= "<set label='Weeds' value='".$row_strQuery['weeds']."' color='00FF00'/>";
    $strXML .= "<set label='Mold' value='".$row_strQuery['mold']." color='00FF00'/>";
    }
    }
     
    mysql_close($link);
      
     
     
     
    $strXML .= "</chart>";
     
     
           
     
              
    // Set the rendering mode to JavaScript
    FC_SetRenderer('javascript');
     
    // Call the renderChart method, which would return the HTML and JavaScript required to generate the chart
                echo renderChart('Charts/Column2D.swf', // Path to chart type
    '', // Empty string when using Data String Method
    $strXML, // Variable that contains XML string
    'cal_pollen_count', // Unique chart ID
    '680', '400', // Width and height in pixels
    false, // Disable debug mode
    true // Enable 'Register with JavaScript' (Recommended)
    );
            ?>
           

  6. Hi,

     

    With regard to your issue, it seems, the PHP variables $gaugeStartX, $gaugeStartY, $gaugeEndX and $gaugeEndY are not holding any value while building the chart XML string.

     

    Could you please check the values of these variables by echoing and make sure these are assigned with proper values?

     

    In case if this is what is not helping you, please post the complete PHP code of your XML data generation, so that we may better look into your issue.

     

    Awaiting your valuable response.

    Here is the PHP Code:

     

    <?php
       include("../includes/FusionCharts.php");
       include("../includes/FusionCharts_Gen.php");
       include("../includes/DBConn.php");
       
    ?>
    <title>Test chart</title>  
            <script type="text/javascript" src="../Fusion/Widgets/FusionCharts.js"></script>
    <meta charset='utf-8'>
         </HEAD>
         <BODY>
         <CENTER>
         <?php   
       $link = connectToDB();
       
         
        $strXML = "<chart palette='2' manageResize='1' bgAlpha='0' caption='Test chart'  upperLimit='1400' lowerLimit='0' gaugeStartAngle='225' gaugeEndAngle='-45' gaugeFillMix='{light-10},{light-20},{light-60},{dark-30},{dark-40}, {dark-40}' gaugeFillRatio='' gaugeBorderColor='{dark-30}' gaugeOuterRadius='150' gaugeInnerRadius='100' pivotRadius='10' showValue='0' tickValueStep='5' placeValuesInside='1'>";
     
     
     $strXML .="<dials>";
          $strXML .= "<dial value='600' tooltext='Latest count' rearExtension='15' radius='88' baseWidth='12' topWidth='3' bgColor='210B02'/>";
    $strXML .="</dials>";
           
           
      
      $strXML .= "<colorRange><color minValue='0' maxValue='200' code='96C900'/><color minValue='200' maxValue='400' code='618200'/><color minValue='400' maxValue='600' code='FFFB14'/><color minValue='600' maxValue='800' code='EBEB13'/><color minValue='800' maxValue='1000' code='C90000'/><color minValue='1000' maxValue='4000' code='FF0000'/></colorRange>";
       
    $strXML .="<annotations><annotationGroup id='Grp1' constrainedScale='0' showBelow='1'><annotation type='rectangle' x='".$gaugeStartX."' y='".$gaugeStartY."' toX='".$gaugeEndX."' toY='".$gaugeEndY."' fillAlpha='100' fillColor='678000,FCEF27,E00000'/>";
    $strXML .="</annotationGroup>";
    $strXML .="</annotations>";
     
     
      
               $strXML .= "</chart>";
      FC_SetRenderer("javascript");
      echo renderChart("../Fusion/Widgets/AngularGauge.swf", "", $strXML, "miseryAG", 430, 380, 0, 0);
      
       mysql_close($link);
            ?>
     
    Thanks

  7. For some reason when using $StrXML in a PHP Javascript rendered chart FC_renderchart("javascript"), the chart will render perfectly with no error but no annotation either!

     

    The page source is missing the X and Y data points 

     

    $strXML .="<annotation type='rectangle' x='".$gaugeStartX."' y='".$gaugeStartY."' toX='".$gaugeEndX."' toY='".$gaugeEndY."' fillAlpha='100' fillColor='678000,FCEF27,E00000'/>";

     

    <colorRange><color minValue='0' maxValue='200' code='96C900'/><color minValue='200' maxValue='400' code='618200'/><color minValue='400' maxValue='600' code='FFFB14'/><color minValue='600' maxValue='800' code='EBEB13'/><color minValue='800' maxValue='1000' code='C90000'/><color minValue='1000' maxValue='4000' code='FF0000'/></colorRange><annotation><annotationGroup id='Grp1' showBelow='1'><annotation type='rectangle' x=' ' y=' ' toX=' ' toY=' ' fillAlpha='100' fillColor='678000,FCEF27,E00000'/></annotationGroup></annotation>