Skip to content

Instantly share code, notes, and snippets.

@fponticelli
Forked from abergie/config.ini
Created June 4, 2012 13:51
Show Gist options
  • Save fponticelli/2868533 to your computer and use it in GitHub Desktop.
Save fponticelli/2868533 to your computer and use it in GitHub Desktop.
RG Description
cache=2 days
formats=png,html
[params]
start=true
end=true
path=true
<?DOCTYPE html>
<html>
<head>
<title>SnapEngage Stats</title>
<link rel="stylesheet" type="text/css" href="https://api.reportgrid.com/css/rg-charts.css" />
<link rel="stylesheet" type="text/css" href="https://snapabug.appspot.com/css/rg-style.css" />
<link rel="stylesheet" type="text/css" href="https://snapabug.appspot.com/css/rg-snapengage.css" />
<script src="https://api.reportgrid.com/js/reportgrid-core.js?tokenId=87984064-827D-4C42-8BAF-42A748BA6DCA" type="text/javascript"></script>
<script src="https://api.reportgrid.com/js/reportgrid-charts.js" type="text/javascript"></script>
<script src="https://api.reportgrid.com/js/reportgrid-query.js" type="text/javascript"></script>
<script type="text/javascript">
function render()
{
var start = $start;
var end = $end;
var path = "$path";
var sourceTypes = {
"1": "Offline Request",
"2": "Live Chat"
};
ReportGrid.pieChart("#cases", {
axes: ["sourceType", "count"],
load: ReportGrid.query.histogram({
path: path,
event: "case",
start: start,
end: end,
property: "sourceType"
}),
options: {
label: {
datapoint: function (dp, stats) {
return ReportGrid.format(Math.round(1000 * dp.count / stats.tot) / 10, "P:1");
}
}
}
});
ReportGrid.leaderBoard("#caseslegend", {
axes: ["sourceType", "count"],
load: ReportGrid.query.histogram({
path: path,
event: "case",
start: start,
end: end,
property: "sourceType"
}),
options: {
label: {
datapoint: function (dp, stats) {
return sourceTypes[dp["sourceType"]] + ": ";
}
},
colorscale: true
}
});
}
</script>
</head>
<body onload="render()">
<div class="container square">
<div id="caseslegend"></div>
</div>
<div class="container square">
<div id="cases"></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment