class Management::StatisticsController < ManagementController
  def index
    g = Gruff::Line.new
    g.title = "Usuários"
    g.data 'Estudantes', [0, 5, 8, 20]
    g.data 'Professores', [0, 14,20, 40]
    g.labels={
      0 => '1',
      1 => '3',
      2 => '5',
      3 => '7',
      4 => '9'
    }
    g.theme = {
      :colors => ['black', 'grey'],
      :marker_color => 'grey',
      :font_color => 'black',
      :background_colors => 'transparent'
  }
    g.replace_colors(['green','yellow','black'])
    g.marker_count = 1
    g.write("/home/alexandre/projetos/portalmec/app/assets/images/geral_user.png")

    g = Gruff::Line.new
    g.title = "Downloads"
    g.data 'downloads', [0, 5, 8, 20]
    g.labels={
      0 => '1',
      1 => '3',
      2 => '5',
      3 => '7',
      4 => '9'
    }
    g.theme = {
      :colors => ['black', 'grey'],
      :marker_color => 'grey',
      :font_color => 'black',
      :background_colors => 'transparent'
    }
    g.replace_colors(['green','yellow','black'])
    g.marker_count = 1
    g.write("/home/alexandre/projetos/portalmec/app/assets/images/geral_download.png")

    g = Gruff::Line.new
    g.title = "Coleções"
    g.data 'colections', [0, 55, 153, 220]
    g.labels={
      0 => '1',
      1 => '3',
      2 => '5',
      3 => '7',
      4 => '9'
    }
    g.theme = {
      :colors => ['black', 'grey'],
      :marker_color => 'grey',
      :font_color => 'black',
      :background_colors => 'transparent'
    }
    g.replace_colors(['green','yellow','black'])
    g.marker_count = 1
    g.write("/home/alexandre/projetos/portalmec/app/assets/images/geral_colections.png")

    g = Gruff::Line.new
    g.title = "Acessos"
    g.data 'accesses', [0, 415, 388, 320, 577 ]
    g.labels={
      0 => '1',
      1 => '3',
      2 => '5',
      3 => '7',
      4 => '9'
    }
    g.theme = {
      :colors => ['black', 'grey'],
      :marker_color => 'grey',
      :font_color => 'black',
      :background_colors => 'transparent'
    }
    g.replace_colors(['green','yellow','black'])
    g.marker_count = 1
    g.write("/home/alexandre/projetos/portalmec/app/assets/images/geral_accesses.png")
  end

  def usuarios
    g = Gruff::Bar.new
    g.title = "Usuários"
    g.data 'Estudantes', 20
    g.data 'Professores', 40
    g.data 'Curadores', 6
    g.data 'Moderadores', 3
    g.data 'Administradores', 1


    g.labels={

    }
    g.theme = {
      :colors => ['black', 'grey'],
      :marker_color => 'grey',
      :font_color => 'black',
      :background_colors => 'transparent'
  }
    g.replace_colors(['green','yellow','black','purple', 'blue'])
    g.marker_count = 1
    g.write("/home/alexandre/projetos/portalmec/app/assets/images/usuarios.png")
  end

  def downloads

  end

  def accesses
  end

  def destaques
  end

  def colections

    g = Gruff::Pie.new
    g.title = "Por área de atuação"
    g.data 'Filosofia', 45
    g.data 'Matemática', 92
    g.data 'Língua Portuguesa', 78
    g.data 'História', 57
    g.data 'Física', 43
    g.data 'Sociologia', 40
    g.data 'Artes', 3

    g.labels={

    }
    g.theme = {
      :colors => ['black', 'grey'],
      :marker_color => 'grey',
      :font_color => 'black',
      :background_colors => 'transparent'
    }
    g.replace_colors(['green','yellow','black','purple', 'blue', 'brown', 'red'])
    g.marker_count = 1
    g.write("/home/alexandre/projetos/portalmec/app/assets/images/colections.png")
  end

end