// 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, // character false, // dates+builds ], }; var freemodeCategoriesDict = getFreemodeCategoriesDict(); var rosPlatformsDic = getRosPlatformsDict(); var reportOptions = { restEndpoint: config.freemodeRacesStats, restEndpointAsync: config.freemodeRacesStatsAsync, hasFilterInput: true, enablePNGExport: "content-description-controls", enableCSVExport: "content-description-controls", //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 = "

" + x + "


" + "" + ""; if (winningVehicle) html += ""; if (usedVehicle) html += ""; if (typeof e.point.Object.AverageRating !== "undefined") html += ""; if (typeof e.point.Object.UGCIdentifier !== "undefined") html += ""; if (typeof e.point.Object.CreatedDate !== "undefined") html += ""; var creatorPlatform = (e.point.Object.CreatorPlatform) ? (" (" + rosPlatformsDic[e.point.Object.CreatorPlatform] + ")") : ""; if (typeof e.point.Object.Creator !== "undefined") html += ""; if (typeof e.point.Object.Category !== "undefined") html += ""; if (typeof e.point.Object.IsPublished !== "undefined") html += ""; 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") + "
"; return html; }, units: " Times Played", chartLeftMargin: 350, };