Imports InovarMais.Core.Extensions.StringExt

Public Class DonutGraphFornecedorGeral
    Inherits System.Web.UI.Page

    Public Property Titutlo As String
    Public Property Cor As String
    Public Property TheData As String

    Public Property Column1 As String = "'string', 'element'"
    Public Property Column2 As String = "'number', 'value'"

    Public Property style As String
    Public Property Imagem As String

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

        Dim sessionID = Request.QueryString("ID_Graf")

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

        style = "width:180px; height:150px;"

        Titutlo = session.Titutlo

        Cor = session.Cor

        Dim fullObjList = New List(Of String)

        For Each d In session.DataSource
            fullObjList.Add("['" & d.SerieName & "'," & Math.Round(d.DicValues.First.Value, 2, MidpointRounding.AwayFromZero).ToString.Replace(",", ".") & "]")
        Next

        TheData = "[" & String.Join(",", fullObjList) & "]"

        'If IsPostBack Then
        '    EnviaImagemUrl.Attributes.Add("onclick", "return false;")
        'End If
    End Sub


    
   
End Class