def test(self): plot1 = Line(text = "line1", fontsize = 20, values = [None, 5, 1, 2, 4, None, None, 2, 7, 5]) plot2 = Line(text = "line2", fontsize = 12, values = range(-4, 7, 1)) plot3 = Bar_Glass(text = "bar1", values = [4, None, -4, 3, bar_glass_value((5, -2), '#333333', 'Special:<br>Top = #top#<br>Bottom = #bottom#'), 7, None, None, -5, 5]) plot1.set_tooltip('Title1:<br>Amount = #val#') plot2.set_tooltip('Title2:<br>Value = #val#') plot3.set_tooltip('Title3:<br>Height = #val#') plot1.set_on_click('plot1') plot2.set_on_click('plot2') plot1.set_line_style(4, 3) plot2.set_line_style(4, 8) plot1.set_colour('#D4C345') plot2.set_colour('#8084FF') plot3.set_colour('#FF84FF') chart = openFlashChart.template("Testing chart", style = '{font-size: 40px; font-family: Times New Roman; color: #A2ACBA; text-align: right;}') chart.set_x_axis(stroke = 10, colour = '#165132', tick_height = 30, grid_colour = '#AAEE00', offset = True, steps = 2, labels = x_axis_labels(labels = list('sfwertr56w') + [x_axis_label('custom!!', '#2683CF', 24, 'diagonal')], steps = 2)) chart.set_y_axis(stroke = 5, colour = '#1E33FF', tick_length = 15, grid_colour = '#090305', offset = True, steps = 4, min = -6) chart.set_y_axis_right(stroke = 5, colour = '#44FF22', tick_length = 20, grid_colour = '#55ff55', offset = True, steps = 1) chart.set_x_legend("x-axis legend", style = '{font-size: 20px; color: #778877}') chart.set_y_legend("y-axis legend", style = '{font-size: 22px; color: #778877}') chart.set_tooltip(shadow = True, stroke = 4, colour = '#909090', bg_colour = '#FAFAFA', title_style = '{font-size: 14px; color: #CC2A43;}', body_style = '{font-size: 10px; font-weight: bold; color: #000000;}') chart.add_element(plot1) chart.add_element(plot2) chart.add_element(plot3) return chart.encode()
def line(self): plot1 = Line(text="line1", fontsize=20, values=range(0, 10)) plot2 = Line(text="line2", fontsize=06, values=range(10, 0, -1)) plot3 = Line(text="line3", fontsize=12, values=range(-5, 5)) plot1.set_line_style(4, 3) plot2.set_line_style(5, 5) plot3.set_line_style(4, 8) plot1.set_colour('#D4C345') plot2.set_colour('#C95653') plot3.set_colour('#8084FF') chart = openFlashChart.template("Line chart") chart.set_y_axis(min=-6, max=10) chart.add_element(plot1) chart.add_element(plot2) chart.add_element(plot3) return chart.encode()
def line(self): plot1 = Line(text = "line1", fontsize = 20, values = range(0,10)) plot2 = Line(text = "line2", fontsize = 06, values = range(10,0, -1)) plot3 = Line(text = "line3", fontsize = 12, values = range(-5,5)) plot1.set_line_style(4, 3) plot2.set_line_style(5, 5) plot3.set_line_style(4, 8) plot1.set_colour('#D4C345') plot2.set_colour('#C95653') plot3.set_colour('#8084FF') chart = openFlashChart.template("Line chart") chart.set_y_axis(min = -6, max = 10) chart.add_element(plot1) chart.add_element(plot2) chart.add_element(plot3) return chart.encode()
def test(self): plot1 = Line(text="line1", fontsize=20, values=[None, 5, 1, 2, 4, None, None, 2, 7, 5]) plot2 = Line(text="line2", fontsize=12, values=range(-4, 7, 1)) plot3 = Bar_Glass( text="bar1", values=[ 4, None, -4, 3, bar_glass_value( (5, -2), '#333333', 'Special:<br>Top = #top#<br>Bottom = #bottom#'), 7, None, None, -5, 5 ]) plot1.set_tooltip('Title1:<br>Amount = #val#') plot2.set_tooltip('Title2:<br>Value = #val#') plot3.set_tooltip('Title3:<br>Height = #val#') plot1.set_on_click('plot1') plot2.set_on_click('plot2') plot1.set_line_style(4, 3) plot2.set_line_style(4, 8) plot1.set_colour('#D4C345') plot2.set_colour('#8084FF') plot3.set_colour('#FF84FF') chart = openFlashChart.template( "Testing chart", style= '{font-size: 40px; font-family: Times New Roman; color: #A2ACBA; text-align: right;}' ) chart.set_x_axis( stroke=10, colour='#165132', tick_height=30, grid_colour='#AAEE00', offset=True, steps=2, labels=x_axis_labels( labels=list('sfwertr56w') + [x_axis_label('custom!!', '#2683CF', 24, 'diagonal')], steps=2)) chart.set_y_axis(stroke=5, colour='#1E33FF', tick_length=15, grid_colour='#090305', offset=True, steps=4, min=-6) chart.set_y_axis_right(stroke=5, colour='#44FF22', tick_length=20, grid_colour='#55ff55', offset=True, steps=1) chart.set_x_legend("x-axis legend", style='{font-size: 20px; color: #778877}') chart.set_y_legend("y-axis legend", style='{font-size: 22px; color: #778877}') chart.set_tooltip( shadow=True, stroke=4, colour='#909090', bg_colour='#FAFAFA', title_style='{font-size: 14px; color: #CC2A43;}', body_style='{font-size: 10px; font-weight: bold; color: #000000;}') chart.add_element(plot1) chart.add_element(plot2) chart.add_element(plot3) return chart.encode()