// set true for disabled filter
var headerAndFilters = {
headerType: "header-sc", // social club filtering header
disabledFields: // disables header fields
[
false, // platforms
false, // locations
false, // age
false, // gamers
true, // game-types
[true, false, true], // dates+builds
],
};
var currentStat = "Times Chop taken for a walk";
var profStat = new ProfileStats();
var profileStatList = [
{
types: [
"SP_CHOP_WALK_DONE",
],
name: currentStat,
requestSubString: "_",
bucketSize: 1,
singleMetric: true,
showOnlyLowerRange: true,
},
];
var reportOptions = {
restEndpoint: config.profileStatsCombinedDiff,
restEndpointAsync: config.profileStatsCombinedDiffAsync,
availableCharts: profileStatList,
hasExtraRestParams: [
{
key: "StatNames",
value: getStatNames,
},
{
key: "BucketSize",
value: profileStatList[0].bucketSize,
},
],
processFunction: formatData,
enableCSVExport: "content-description",
graphTitle: currentStat,
/* Line graph related */
elementId: "line-area-chart",
backgroundColour: "#ffffff",
lineColour: config.chartColour1,
textColour: "#000000",
gridColour: "#333333",
name: function(d) { return profStat.getName(d, profileStatList[0]); },
value: function(d) {
return ((d.TotalUsers) ? (Number(d.YValue)/d.TotalUsers)*100 : 0);
},
fullName: function(d, extra) { return ((extra) ? this.name(d) + "
(" + extra + ")" : this.name(d)); },
label: function(d) {return ((d.label) ? d.label : this.name(d)); },
xLabel: currentStat,
yLabel: "Percentage of Players (%)",
orientation: "horizontal",
margin: {top: 10, right: 10, bottom: 10, left: 10},
//orientation: "vertical",
//margin: {top: 10, right: 10, bottom: 10, left: 200},
hideLegend: true,
legend: {height: 30, width: 180, rectWidth: 18},
legendDataConst : [],
legendDataVar: {label : currentStat, colour: config.chartColour1}, // keep this colour in sync with lineColour
valueTooltipContent: function(d, b) {
var content = "
| Percentage of Players: | " + commasFixed2(this.value(d)) + " % |
| Number of Players: | " + commasFixed2(Number(d.YValue)) + " |
| Total Players: | " + commasFixed2(d.TotalUsers) + " |