// 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 false, // dates+builds ], }; var freemodeCategoriesDict = getFreemodeCategoriesDict(); var rosPlatformsDic = getRosPlatformsDict(); var reportOptions = { restEndpoint: config.freemodeRacesStats, restEndpointAsync: config.freemodeRacesStatsAsync, hasFilterInput: true, enableCSVExport: "content-description", graphTitle: "Races", chartGroups: { getGroups: function(d) {return [d]}, // One group getGroupName: function(d) {return ""}, getGroupValues: function(d) {return d}, }, bars: [ { title: ((project.freemodeAltName) ? project.freemodeAltName : "Freemode") + " Races breakdown (times played)", colour: config.chartColour1, getName: function(d) {return d.Name + " (" + d.UGCIdentifier + ")"; }, getValue: function(d) {return d.TimesPlayed; }, getObject: function(d) {return d; }, }, ], tooltipContent: function(key, x, y, e, graph) { // Sort the winning vehicles desc and get the top value var winningVehicle = e.point.Object.WinnerInfo.sort( function(a, b) { return (a.TimesWon > b.TimesWon) ? -1 : 1; } )[0]; // Sort the selected vehicles desc and get the top value var usedVehicle = e.point.Object.SelectionInfo.sort( function(a, b) { return (a.TimesUsed > b.TimesUsed) ? -1 : 1; } )[0]; var html = "
| Times Played: | " + e.point.Object.TimesPlayed + " |
| Most Winning Vehicle: | " + capitaliseString(winningVehicle.VehicleName) + " (" + winningVehicle.TimesWon + " times) |
| Most Selected Vehicle: | " + capitaliseString(usedVehicle.VehicleName) + " (" + usedVehicle.TimesUsed + " times) |
| Average Rating: | " + commasFixed2(e.point.Object.AverageRating) + " |
| UGC ID: | " + e.point.Object.UGCIdentifier + " |
| Created At: | " + parseJsonDate(e.point.Object.CreatedDate).toUTCString() + " |
| Creator: | " + e.point.Object.Creator + creatorPlatform + " |
| Category: | " + freemodeCategoriesDict[e.point.Object.Category] + " |
| UGC Status: | " + ((e.point.Object.IsPublished) ? "Published" : "Saved") + " |