You need to sign in to do that
Don't have an account?
How to pass field values in JavaScript code in visualforce page
Hi all,
I am creating dashboard in visualforce page using javascript, i passed values statically, how to pass opportunities object values in Rows in javascript.
javascript code:
<apex:page standardController="opportunity">
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {packages:['imagelinechart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Months');
data.addColumn('number', 'amount');
data.addColumn('number', 'amount2')
data.addRows([
['jan', 20000,25000],
['feb', 28000,20000],
['Mar', 30000,15000],
['Apr', 40000,10000],
['May',13000,25000]
]);
var chart = new google.visualization.ImageLineChart(document.getElementById('chart_div'));
chart.draw(data, {width: 800, height: 500, min: 0});
}
</script>
</head>
<body>
<div id='chart_div'></div>
</body>
</html>
</apex:page>
http://infallibletechie.blogspot.in/2013/01/how-to-write-javascript-validation-for.html
Check this..
Regards,
Magulan D
Salesforce.com certified Force.com Developer.
SFDC Blog
SFDC Site
If this post is your solution, kindly mark this as the solution.