KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /home/queenjbs/www/FusionChart/Contents/advanced/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/queenjbs/www/FusionChart/Contents/advanced/Gradients.html
<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Gradients</title>
<link rel="stylesheet" href="../assets/ui/css/style.css" type="text/css" />
<script type="text/javascript" src="../assets/prettify/prettify.js"></script>
<link rel="stylesheet" type="text/css" href="../assets/prettify/prettify.css" />
<script type="text/javascript" src="../assets/ui/js/jquery.min.js" ></script>
<style type="text/css">
<!--
div.WebHelpPopupMenu { position:absolute;
left:0px;
top:0px;
z-index:4;
visibility:hidden; }

a.whtbtnhide, a.whtbtnshow, a.whtbtnhidenav , a.whtbtnshownav { border-bottom:none !important; }
-->
</style>
<script type="text/javascript" language="javascript1.2" src="../assets/ui/js/whmsg.js"></script>
<script type="text/javascript" language="javascript" src="../assets/ui/js/whver.js"></script>
<script type="text/javascript" language="javascript1.2" src="../assets/ui/js/whproxy.js"></script>
<script type="text/javascript" language="javascript1.2" src="../assets/ui/js/whutils.js"></script>
<script type="text/javascript" language="javascript1.2" src="../assets/ui/js/whlang.js"></script>
<script type="text/javascript" language="javascript1.2" src="../assets/ui/js/whtopic.js"></script>
<script type="text/javascript" src="../assets/ui/js/lib.js"></script>
</head>

<body>
<!-- breadcrumb starts here -->
<div id="breadcrumb"></div>
<script type="text/javascript">
	document.write( addFCBreadcrumb( [ "Home|../Introduction/Overview.html", "Advanced charting", "Using Gradients" ] ) );
</script>
<!-- breadcrumb ends here -->


<table width="98%" border="0" cellspacing="0" cellpadding="3" align="center">
  <tr> 
    <td class="pageHeader">Gradients</td>
  </tr>
  <tr> 
    <td valign="top" class="text"><p>FusionCharts XT allows options to gradient fill for various chart elements like background, canvas, plot etc. You can now fill these chart objects using gradient patterns, whose properties can be decided and set by you.</p>
      <p>We will use the example of background and see how to apply gradients to background, as the background is common to all charts. The background of each chart can be configured using the following four  attributes:</p>
    <table class="table" border="0" cellpadding="2" cellspacing="0" width="85%" >
      <tr class="trVeryLightGrayBg">
        <td width="15%" valign="top" class="codeInline">bgColor </td>
        <td width="70%" valign="top" class="text">This attribute sets the background   color for the chart. To specify a gradient as background color, separate the hex color   codes of each color in the gradient using comma. Example: FF5904,FFFFFF.   Remember to remove # and any spaces in between. </td>
      </tr>
      <tr>
        <td valign="top" class="codeInline">bgAlpha </td>
        <td valign="top" class="text">Sets the alpha (transparency) for   the background. If you have opted for gradient background, you need to set a list   of alpha(s) separated by comma.</td>
      </tr>
      <tr class="trVeryLightGrayBg">
        <td valign="top" class="codeInline">bgRatio </td>
        <td valign="top" class="text">If you have opted for a gradient   background, this attribute lets you set the ratio of each color constituent. </td>
      </tr>
      <tr>
        <td valign="top" class="codeInline">bgAngle </td>
        <td valign="top" class="text">Angle of the background color, in   case of a gradient. </td>
      </tr>
    </table>    
    <p class="header"><a name="example" id="example"></a>In Example</p>
    <p>Let us now see how to apply a simple custom gradient to the background. We will create a gradient that starts from orange (#ff5904) and fades into white (#ffffff) and will be evenly distributed on the background. For a start, we will set the alpha as 100 for both the color constituents and set angle as 0 degree (left to right). The following data helps us do so: </p></td>
  </tr>
  <tr>
    <td valign="top">
    <div class="container">
    <ul class="tabs">
       <li><a href="#tab1">XML</a></li>
       <li><a href="#tab2">JSON</a></li>
    </ul>
    <div class="tab_container">
       <div id="tab1" class="tab_content"><pre class="prettyprint code_container">&lt;chart bgColor='FF5904,FFFFFF' bgAlpha='100,100' bgRatio='0,100' bgAngle='0'&gt;
&nbsp;&nbsp;&nbsp;&lt;set label='John' value='420' /&gt;
&nbsp;&nbsp;&nbsp;&lt;set label='Mary' value='295' /&gt;
&nbsp;&nbsp;&nbsp;&lt;set label='Tom' value='523' /&gt; 
&lt;/chart&gt;</pre></div>
<div id="tab2" class="tab_content">
  <pre id="pre-datajson" class="prettyprint code_container">{<br />&nbsp; &quot;chart&quot;:{<br />&nbsp; &nbsp; &quot;bgcolor&quot;:&quot;FF5904,FFFFFF&quot;,<br />&nbsp; &nbsp; &quot;bgalpha&quot;:&quot;100,100&quot;,<br />&nbsp; &nbsp; &quot;bgratio&quot;:&quot;0,100&quot;,<br />&nbsp; &nbsp; &quot;bgangle&quot;:&quot;0&quot;<br />&nbsp; },<br />&nbsp; &quot;data&quot;:[{<br />&nbsp; &nbsp; &nbsp; &quot;label&quot;:&quot;John&quot;,<br />&nbsp; &nbsp; &nbsp; &quot;value&quot;:&quot;420&quot;<br />&nbsp; &nbsp; },<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &quot;label&quot;:&quot;Mary&quot;,<br />&nbsp; &nbsp; &nbsp; &quot;value&quot;:&quot;295&quot;<br />&nbsp; &nbsp; },<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &quot;label&quot;:&quot;Tom&quot;,<br />&nbsp; &nbsp; &nbsp; &quot;value&quot;:&quot;523&quot;<br />&nbsp; &nbsp; }<br />&nbsp; ]<br />}</pre>
</div></div></div></td>
  </tr>
  <tr>
    <td valign="top" class="text"><p>Here, we are first defining  <span class="codeInline">bgColor</span> as a comma separated list of colors (hex codes without #) which we want our gradient to contain. </p>
      <p>Now for each color, we have to specify an <span class="codeInline">alpha</span> in <span class="codeInline">bgAlpha</span> attribute, again as comma separated values.  When this attribute is defined as <span class="codeInline">bgAlpha=&quot;80,50&quot;</span>   and is coupled with <span class="codeInline">bgColor=&quot;FF5904,FFFFFF&quot;</span>, the   color <span class="codeInline">FF5904</span> will be shown in 80% alpha while the   color <span class="codeInline">FFFFFF</span> will be shown in 50% alpha. <br />
      <br />
      Please note that when you use this attribute, you need to make sure that   number of colors defined in <span class="codeInline">bgColor</span> is same as the   number of alpha defined in <span class="codeInline">bgAlpha</span>. For example,   if you are creating a gradient fill by specifying two colors, then you need to   specify two alphas for this attribute as well, or else you may get unexpected   results. </p>
      <p>Next, we have defined our ratio for the gradient fill as <span class="codeInline">bgRatio='0,100'</span>. When this attribute is defined as <span class="codeInline">bgRatio=&quot;80,20&quot;</span>   and is coupled with <span class="codeInline">bgColor=&quot;FF5904,FFFFFF&quot;</span>, the   color <span class="codeInline">FF5904</span> will occupy 80% of the gradient fill   while the color <span class="codeInline">FFFFFF</span> will get 20%. As in <span class="codeInline">bgAlpha</span>, there needs to be as many ratio values   separated by commas as there are colors in <span class="codeInline">bgColor</span>. Also, the sum of all the ratio values should be   100. 
      By default, FusionCharts XT splits all the   colors in the list proportionally, that is, if you have two colors and do not define   this attribute, then both the colors will have 50% fill ratio. </p>
      <p>Finally, we set the angle of the gradient as 0 degree (left to right).</p>
    <p>When you now see the chart, you will get the following output: </p></td>
  </tr>
  <tr>
    <td valign="top" class="text"><img src="Images/Gradient.jpg" width="388" height="206" /></td>
  </tr>
  <tr>
    <td valign="top" class="text"><p>In this example, we only saw how to apply gradient to background. In 2D charts, you can apply gradients to chart canvas also.</p>
    <p>Moreover, in Column 2D and Area 2D charts, you can use <span class="codeInline">plotGradientColor</span> attribute to specify gradients for dataplot too. </p></td>
  </tr>
</table>
<!-- footer links starts-->
<div id="fcfooter"></div>
<script type="text/javascript">
	document.getElementById("fcfooter").innerHTML =  addFCFooter("Showing long data labels|Adv_DataLabels.html", "Tooltip in multiple lines|TTip_Lines.html");
</script>
<!-- footer links ends -->
<script type="text/javascript" language="javascript1.2">//<![CDATA[
<!--

	highlightSearch();

//-->
//]]></script>
</body>
</html>

Anon7 - 2021