Esempio n. 1
0
def charts():
  try:
    dateline = pygal.Line()

    config = Config()
    config.box_mode = True

    dateline = pygal.Line(config)
    dateline.title = 'Remaining Stories/Bugs'
    dateline.x_labels = ['21 May 2018','28 May 2018','4 June 2018','11 June 2018','18 June 2018','25 June 2018','2 July 2018','9 July 2018','16 July 2018','23 July 2018','30 July 2018','6 August 2018','13 August 2018','20 August 2018','27 August 2018','3 September 2018','10 September 2018']

    dateline.add('Glacier',       [None, None, None, None, None, 0, 7, 1, 1, 16, 17, 15, 16, 14, 15, 16])
    dateline.add('APS',           [None, None, None, None, None, None, None, 0, 60, 128, 128, 117, 120, 121, 116, 118])
    dateline.add('AWS Migration', [9, 9, 9, 7, 9, 13, 9, 27, 81, 97, 96, 93, 85, 94, 86, 90, 79])
    dateline.add('DBP Builder App', [None, None, None, None, None, None, None, 0, 4, 14, 16, 16, 26, 41, 46, 46, 30])
    dateline.add('Workspace',      [None, None, None, None, None, None, None, None, 0, 69, 62, 62, 61, 61, 55, 60, 64])
    
    graph_data = dateline.render_data_uri()

    return render_template("dateline.html",graph_data=graph_data)
  except Exception as e:
    return (str(e))
Esempio n. 2
0
from pygal import Config

#define the chart settings
custom_style = Style(
    guide_stroke_dasharray='1,4',
    major_guide_stroke_dasharray='2,4',
    colors=('#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5',
            '#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5',
            '#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5',
            '#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5', '#5B9BD5',
            '#5B9BD5'))

config = Config()
config.show_legend = False
config.show_x_lables = True
config.box_mode = 'tukey'
config.x_title = 'Hour'
config.y_title = 'GB'
config.x_labels = [
    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
    21, 22, 23
]


def genBoxPlot(plotTitle, srcPath, svgName, plotStartDate):
    dirs = os.listdir(srcPath)

    dictHoursWeekday = {0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],\
                   10:[],11:[],12:[],13:[],14:[],15:[],16:[],17:[],18:[],19:[],\
                   20:[],21:[],22:[],23:[]}