public static void PlotOneGraph( System.Web.UI.HtmlControls.HtmlGenericControl barD, System.Web.UI.HtmlControls.HtmlGenericControl barI,
System.Web.UI.HtmlControls.HtmlGenericControl barS, System.Web.UI.HtmlControls.HtmlGenericControl barC,
int scoreD, int scoreI, int scoreS, int scoreC, int maxScale )
{
barD.RemoveCssClass( "discbar-primary" );
barI.RemoveCssClass( "discbar-primary" );
barS.RemoveCssClass( "discbar-primary" );
barC.RemoveCssClass( "discbar-primary" );
// find the max value
var maxScore = barD;
var maxValue = scoreD;
if ( scoreI > maxValue )
{
maxScore = barI;
maxValue = scoreI;
}
if ( scoreS > maxValue )
{
maxScore = barS;
maxValue = scoreS;
}
if ( scoreC > maxValue )
{
maxScore = barC;
maxValue = scoreC;
}
maxScore.AddCssClass( "discbar-primary" );
var score = Math.Floor( (double)( (double)scoreD / (double)maxScale ) * 100 ).ToString();
barD.Style.Add( "height", score + "%" );
barD.Attributes["title"] = scoreD.ToString();
score = Math.Floor( (double)( (double)scoreI / (double)maxScale ) * 100 ).ToString();
barI.Style.Add( "height", score + "%" );
barI.Attributes["title"] = scoreI.ToString();
score = Math.Floor( (double)( (double)scoreS / (double)maxScale ) * 100 ).ToString();
barS.Style.Add( "height", score + "%" );
barS.Attributes["title"] = scoreS.ToString();
score = Math.Floor( (double)( (double)scoreC / (double)maxScale ) * 100 ).ToString();
barC.Style.Add( "height", score + "%" );
barC.Attributes["title"] = scoreC.ToString();
}
#endregion