You need to sign in to do that
Don't have an account?
Visualforce Page
Im trying to put a gauge onto the account page. Im using the field "variance_by_percentage__c" which I put into the ['label', 'value']. is this the right place to put it. I am getting the error: Unknown property 'Account.Variance-by_Percentage__c' referenced in Variance_Gauge which is the name of the page im trying to create. I want to show the gauge for the account im in. os that is why i am also using ?id on line #2. Any sugguestions
<apex:page>
?id=
<apex:sectionHeader title="FRS GROUP DASHBOARD"/>
<font size="20" color="darkblue" > <center> <b> FRS </b> </center> </font>
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {packages:['gauge']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.arrayToDataTable([
['Label', 'Value'],
['Variance', value = "{!Account.Variance_by_Percentage__c}"],
]);
var options = {
width: 400, height: 120,
greenFrom: -5, greenTo: 5,
majorTicks: [-20, -15, -10, -5, 0, 5, 10, 15, 20]
Min: -20,
Max: 20,
};
var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
chart.draw(data, options);
</script>
</head>
<body>
<div id='chart_div' ></div>
<div id='visualization' style="width: 1500px; height: 700px "></div>
</body>
</html>
</apex:page>
<apex:page>
?id=
<apex:sectionHeader title="FRS GROUP DASHBOARD"/>
<font size="20" color="darkblue" > <center> <b> FRS </b> </center> </font>
<html>
<head>
<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type='text/javascript'>
google.load('visualization', '1', {packages:['gauge']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.arrayToDataTable([
['Label', 'Value'],
['Variance', value = "{!Account.Variance_by_Percentage__c}"],
]);
var options = {
width: 400, height: 120,
greenFrom: -5, greenTo: 5,
majorTicks: [-20, -15, -10, -5, 0, 5, 10, 15, 20]
Min: -20,
Max: 20,
};
var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
chart.draw(data, options);
</script>
</head>
<body>
<div id='chart_div' ></div>
<div id='visualization' style="width: 1500px; height: 700px "></div>
</body>
</html>
</apex:page>
<apex:page standardcontroller="Account" sidebar="false" showHeader="false">
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["gauge"]});
google.setOnLoadCallback(drawChart);
function drawChart()
{ var data = google.visualization.arrayToDataTable([
['Label', 'Value'], ['Variance', 0],
]);
var options = {
width: 600, height: 320, greenFrom: -5,
greenTo: 5,
min: -50,
max: 50,
majorTicks: [-20, -15, -10, -5, 0, 5, 10, 15, 20] };
var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
chart.draw(data, options);
setInterval(function() {
data.setValue(0, 1, 40 + Math.round(60 * Math.random()));
chart.draw(data, options);
}, 13000); }
</script>
</head>
<body>
<div id="chart_div" style="width: 400px; height: 120px;"></div>
</body>
</html>
</apex:page>