How to show total value with legend in Fustion Chart - fusioncharts

By Using Fusion Chart am able to show the 2d donut chart after reading the documentation provided by fusion chart but in below code i am using legend on left hand side where i want related data to be displayed just below the legend label.
For example my label in this code is Electric Power Generation and it value is 20 so i want this 20 to be shown below the legend label.
If it is possible , please let me know how to do that.
<html>
<head>
<title>My First chart using FusionCharts - Using JavaScript</title>
<script type="text/javascript" src="FusionCharts.js"></script>
</head>
<body>
<div id="chartContainer">FusionCharts XT will load here!</div>
<div id="chartContainer1" style="margin-left: 50%;
margin-right: 10%;
margin-top: -22%;">FusionCharts XT will load here!</div>
<script type="text/javascript"><!--
var myChart = new FusionCharts( "Doughnut2D.swf",
"myChartId", "500", "300", "0", "0");
var dataString ='<chart caption="View Indusries" showLabels="0" showValues="0" showLegend="1" legendPosition="RIGHT" chartrightmargin="40" bgcolor="ECF5FF" bgalpha="70" bordercolor="C6D2DF"\n\
basefontcolor="2F2F2F" basefontsize="11" showpercentvalues="1" bgratio="0" startingangle="200" animation="1">\n\
<set value="20" label="Electric Power Generation" color="005C8E"/>\n\
<set value="32" label="Industrial Processes" color="00759B"/>\n\
<set value="12" label="Residential and Commercial Activities" color="0296D2"/>\n\
<set value="20" label="Agriculture" color="40C7F9"/>\n\
<set value="2" label="Waste Disposal" color="00496C"/>\n\
</chart>';
myChart.setXMLData( dataString );
myChart.render("chartContainer");
// -->
</script>
</body>
</html>

I got the solution for this which is given below
var toalval = 20000;
<set value="20" label="Electric Power Generation \r\ '+dsa+'" displayValue="Electric Power Generation" color="005C8E"/>\n\

Related

Update the Bing map based on new coordinate in realtime

Goal:
Update the visual position in bing map.
Problem:
If I add new latitude and logitude coordinate in the textbox, the bing should be displayed but it doesn't work.
Info:
*You need to use your own api key code.
*---http://jsbin.com/zegimofege/edit?html,console,output
Thank you!
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<!-- Reference to the Bing Maps SDK -->
<script type='text/javascript'
src='http://www.bing.com/api/maps/mapcontrol?callback=GetMap&key=[your kep]'
async defer></script>
<script type='text/javascript'>
function GetMap()
{
var map = new Microsoft.Maps.Map('#myMap', {
credentials: 'Your Bing Maps Key',
mapTypeId: Microsoft.Maps.MapTypeId.road,
center: new Microsoft.Maps.Location(parseInt(document.getElementById("log")), parseInt(document.getElementById("lat"))),
zoom: 10
});
}
</script>
</head>
<body onload="GetMap();">
<div id="myMap" style="position:relative;width:600px;height:400px;"></div>
Log: <input type="text" id="log" value="51.50632"><br>
Lat: <input type="text" id="lat" value="-0.12714"><br>
</body>
</html>
You've added no code to do anything when the text box values are updated. Add events to them. Which event you use is up to you, some to consider, keyup, unfocus, or add an update button. In the event handler, get these values and convert to floats using parseFloat, then set the map view like this map.setView({ center: new Microsoft.Maps.Location(lat, lon) })

HTA Time Picker

I'm building an HTA (userform) and would like to add a Time Picker but have been unsucessful getting something to work. I'm using the JQuery Date Picker successfully, but their website does not have any reference to using a Time Picker, or manipulating the date picker to show the time. Since HTA is a stand alone applicaiton I know my options are limited, but hopefully someone knows what I'm missing here. Thanks!
<HEAD>
<meta charset="utf-8" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<style type="text/css">
.ui-datepicker {
background: #035c7e;
border: 1px solid #555;
color: #EEE;}
</style>
<script>
$(function() {
$( "#datepicker1" ).datepicker(); });
</script>
</HEAD>
<BODY>
Shift Date: <input type="text" name="StartDate" id= "datepicker1" size="8">
Start Time: <input type="text" name="StartTime" id= "" size="8">
etc.
</BODY>
Download the 2 external js-files and include them from local filesystem.

Fusion Chart - How to change default legend icon version 3.3.1

I am using Fusion Chart version 3.3.1 and I found all the solution as per the requirement on the forum and stackoverflow. Chart is working fine for me but please let me know whether it is possible to change the default icon for legend. We don't want to show that default icon for legend and client has given us the icon for the legend which we need to use it in our fusion chart. Code is given below ,please let me know if anything i can change here or there is any other configuration for changing the legend icon.
<html>
<head>
<title>My First chart using FusionCharts - Using JavaScript</title>
<script type="text/javascript" src="FusionCharts.js"></script>
</head>
<body>
<div id="chartContainer">FusionCharts XT will load here!</div>
<div id="chartContainer1" style="margin-left: 50%;
margin-right: 10%;
margin-top: -22%;">FusionCharts XT will load here!</div>
<script type="text/javascript"><!--
var myChart = new FusionCharts( "Column2D.swf",
"myChartId", "500", "300", "0", "0");
var dataString ='<chart palette="2" caption="Industries" xAxisName="Days in Month" yAxisName="" labelDisplay="Rotate" showValues="0" decimals="0" formatNumberScale="0" bgcolor="FFFFFF" useRoundEdges="1" bgColor="FFFFFF,FFFFFF" showBorder="0">\n\
<set value="20" label="Electric Power Generation" color="005C8E"/>\n\
<set value="32" label="Industrial Processes" color="00759B"/>\n\
<set value="12" label="Residential and Commercial Activities" color="0296D2"/>\n\
<set value="20" label="Agriculture" color="40C7F9"/>\n\
<set value="2" label="Waste Disposal" color="00496C"/>\n\
</chart>';
myChart.setXMLData( dataString );
myChart.render("chartContainer");
// -->
</script>
</body>
</html>

Fusion Chart - How to define some onclick event in Column 2d chart after ploating

I am using fusion chart and it is working perfectly fine in ipad. My code given below
<html>
<head>
<title>My First chart using FusionCharts - Using JavaScript</title>
<script type="text/javascript" src="FusionCharts.js"></script>
</head>
<body>
<div id="chartContainer">FusionCharts XT will load here!</div>
<div id="chartContainer1" style="margin-left: 50%;
margin-right: 10%;
margin-top: -22%;">FusionCharts XT will load here!</div>
<script type="text/javascript"><!--
var myChart = new FusionCharts( "Column2D.swf",
"myChartId", "500", "300", "0", "0");
var dataString ='<chart palette="2" caption="Industries" xAxisName="Days in Month" yAxisName="" labelDisplay="Rotate" showValues="0" decimals="0" formatNumberScale="0" bgcolor="FFFFFF" useRoundEdges="1" bgColor="FFFFFF,FFFFFF" showBorder="0">\n\
<set value="20" label="Electric Power Generation" color="005C8E"/>\n\
<set value="32" label="Industrial Processes" color="00759B"/>\n\
<set value="12" label="Residential and Commercial Activities" color="0296D2"/>\n\
<set value="20" label="Agriculture" color="40C7F9"/>\n\
<set value="2" label="Waste Disposal" color="00496C"/>\n\
</chart>';
myChart.setXMLData( dataString );
myChart.render("chartContainer");
// -->
</script>
</body>
</html>
Now i want to some other activities on click of column chart. For example like if i click on Agriculture which is having value 20 so based on this value i want some search activity or any other activity. Like if i click on Agriculture it will go to other event which i can define on click of Agriculture. Just let me know how to apply click event on Column 2d chart.
Below Code is working as per the requirement but only works on firefox .Please let me know any thing required for that to work on all browser and mobile devices as well.
<html>
<head>
<title>JavaScript Link Example</title>
<script language="JavaScript" src="FusionCharts.js"></script>
<SCRIPT LANGUAGE="JavaScript"><!--
function myJS(myVar){
window.alert(myVar);
}
// --></SCRIPT>
</head>
<body bgcolor="#ffffff">
<div id="chartdiv" align="center">The chart will appear within this DIV. This text will be replaced by the chart.</div>
<script type="text/javascript"><!--
var myChart = new FusionCharts("Charts/Column2D.swf",
"myChartId", "500", "300", "0",
"0");
myChart.setXMLUrl("Data.xml");
myChart.render("chartdiv");
// --></script>
</body>
</html>
And this is Data.xml content
<chart caption='ABC Bank Branches' subCaption='(In
Asian Countries)' yaxislabel='Branches' xaxislabel='Country'>
<set label='Hong Kong' value='235' link="JavaScript:myJS('Hong Kong,235');"/>
<set label='Japan' value='123' link="JavaScript:myJS('Japan, 123');"/>
<set label='Singapore' value='129' link="JavaScript:myJS('Singapore, 129');"/>
<set label='Malaysia' value='121' link="JavaScript:myJS('Malaysia, 121');"/>
<set label='Taiwan' value='110' link="JavaScript:myJS('Taiwan, 110');"/>
<set label='China' value='90' link="JavaScript:myJS('China, 90');"/>
<set label='S. Korea' value='86' link="JavaScript:myJS('S.Korea, 86');"/>
</chart>

Populating a dojo combobox when dojo.ready (dojo 1.7)

I have a comboxbox loading its data from a url store. My code is below... What I noticed in Firebug is that the Combobox loads this info once I put the focus on it. I would love to have the Combobox to populate when the page is done loading.I am guessing I use dojo.ready for this? Does anyone have a suggestion as to how I would pull this off? Many thanks! Janie
<!DOCTYPE html>
<html >
<head>
<link rel="stylesheet" type="text/css" href="lib/dojo/dijit/themes/claro/claro.css" />
<style type="text/css">html, body {
width: 100%;
height: 100%;
margin: 0;
}</style>
<script src="lib/dojo/dojo/dojo.js" data-dojo-config="parseOnLoad: true"></script>
<script>require(["dojo/ready", "dojo/data/ItemFileReadStore", "dijit/form/ComboBox"]);
</script>
</head>
<body class="claro">
<label for="user">User: </label>
<div dojoType="dojo.data.ItemFileReadStore" url="test.json" jsId="countryStore">
<input dojoType="dijit.form.ComboBox" searchAttr="last_name" store="countryStore" class="selectionNav tableData" value="" name="last_name" id="test.json" />
</body>
</html>
your require function should look something like this
require(["dojo/ready", "dijit/registry", "dojo/data/ItemFileReadStore"],function(dom,reg,store){
var combo = dijit.byId("test.json");
var storeDate = new store({url:"path/to/file.json"});
try{
combo.store(storeData);
}catch(e){
combo.set("store",storeData)
}
});
the try catch statement is because I don't remember which is the correct one