/// <summary> /// Sets up the results page for the FollowerStats mode /// </summary> public void SetupFollowerStatPage(string username, string relationship, int followerCount, Link mostActiveLinkRoot, Link mostTvLinkRoot, Link countryLinkRoot, Dictionary <int, int> ratingMap) { FollowerStatsPanel.Invoke((MethodInvoker)(() => { FollowerStatTimer.Stop(); FollowerStatProgressLabel.Visible = false; })); FollowerStatsResultsPanel.Invoke((MethodInvoker)(() => { FollowerStatsResultsPanel.Visible = true; TitleUsernameLabel.Text = char.ToUpper(username[0]) + username.Substring(1) + "'s"; FollowerStatFollowersLabel.Text = followerCount + " " + relationship; string tvOutputString = GetOutputString(mostTvLinkRoot, true, ""); string timePlayedOutputString = GetOutputString(mostActiveLinkRoot, true, ""); string countryOutputString = GetOutputString(countryLinkRoot, false, ""); FollowerStatCountryLabel.Text = "Most popular countries: \n" + countryOutputString; TVLabel.Text = "Most time on TV: \n" + tvOutputString; TimePlayedLabel.Text = "Most time played: \n" + timePlayedOutputString; RatingChart.Series.Clear(); RatingChart.ChartAreas.Clear(); RatingChart.Legends.Clear(); RatingChart.ChartAreas.Add("ChartArea1"); RatingChart.Series.Add("Frequency"); foreach (int key in ratingMap.Keys) { if ((ratingMap[key] != 0 || key < 2000) && relationship == "Followers") { RatingChart.Series["Frequency"].Points.AddXY(key, ratingMap[key]); } else if ((ratingMap[key] != 0 || key > 1400) && relationship == "Following") { RatingChart.Series["Frequency"].Points.AddXY(key, ratingMap[key]); } } })); ChangePage(4); }
private void FollowerStatCancelButton_Click(object sender, EventArgs e) { FollowerStatsPanel.Invoke((MethodInvoker)(() => { FollowerStatTimer.Stop(); FollowerStatProgressLabel.Visible = false; })); if (CancelButtonHit != null) { CancelButtonHit(); } }