Public Class GaugeGraphBlack
    Inherits System.Web.UI.Page

    Public Property Titutlo As String

    Public Property TheEmptyData As String
    Public Property TheData As String
    Public Property TheTooltip As String

    Public Property MixRedLine As Integer

    Public Property style As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        'Dim s = UserSession.Get

        Dim sessionID = Request.QueryString("ID_Graf")

        'If Not s.GrafSession.ContainsKey(sessionID) Then Exit Sub

        Dim session = DashboardContabilidade.SessionH.GrafSession(sessionID) 's.GrafSession(sessionID)

        style = "width:" & session.GWidth - 20 & "px; height:" & session.GHeight - 35 & "px;"

        Titutlo = session.Titutlo
        MixRedLine = (100 - session.RedLine)

        If session.DataSource.Count = 0 Then
            TheData = "[['Label','Value'],['%', 0]]"
            TheEmptyData = "[['Label','Value'],['', 0]]"
            Exit Sub
        End If

        TheTooltip = session.DataSource.First.Tooltip

        TheData = "[['Label','Value'],['" & session.DataSource.First.DicValues.First.Key & "', " & Math.Round(session.DataSource.First.DicValues.First.Value, 2, MidpointRounding.AwayFromZero).ToString.Replace(",", ".") & "]]"
        TheEmptyData = "[['Label','Value'],['" & session.DataSource.First.DicValues.First.Key & "', 0]]"
    End Sub

End Class