def ajax(self, count): if int(count) % 3 is 0: plot = Line_Dot(text="line1", fontsize=20, values=[ None, 5, dot_value(1, '#D02020', '#val#<br>Text'), 2, 4, None, None, 2, 7, 5 ]) elif int(count) % 3 is 1: plot = Line(text="line2", fontsize=12, values=range(-4, 7, 1)) else: plot = 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 ]) plot.set_tooltip('Title1:<br>Amount = #val#') plot.set_on_click('plot1') plot.set_line_style(4, 3) plot.set_colour('#D4C345') chart = openFlashChart.template( "Testing chart: %s" % count, 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, 210)], 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(plot) return chart.encode()
def ajax(self, count): if int(count) % 3 is 0: plot = Line_Dot(text = "line1", fontsize = 20, values = [None, 5, dot_value(1, '#D02020', '#val#<br>Text'), 2, 4, None, None, 2, 7, 5]) elif int(count) % 3 is 1: plot = Line(text = "line2", fontsize = 12, values = range(-4, 7, 1)) else: plot = 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]) plot.set_tooltip('Title1:<br>Amount = #val#') plot.set_on_click('plot1') plot.set_line_style(4, 3) plot.set_colour('#D4C345') chart = openFlashChart.template("Testing chart: %s" %count, 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, 210)], 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(plot) return chart.encode()
def line_dot(self): plot1 = Line_Dot(values=[ math.sin(float(x) / 10) * 1.9 + 4 for x in range(0, 62, 2) ]) plot2 = Line_Dot(values=[ math.sin(float(x) / 10) * 1.9 + 7 for x in range(0, 62, 2) ]) plot3 = Line_Dot(values=[ math.sin(float(x) / 10) * 1.9 + 10 for x in range(0, 62, 2) ]) plot1.set_halo_size(0) plot2.set_halo_size(1) plot3.set_halo_size(3) plot1.set_width(1) plot2.set_width(2) plot3.set_width(6) plot1.set_dot_size(4) plot2.set_dot_size(4) plot3.set_dot_size(6) chart = openFlashChart.template("Line_Dot chart") chart.set_y_axis(min=0, max=15, steps=5) chart.add_element(plot1) chart.add_element(plot2) chart.add_element(plot3) return chart.encode()
def line_dot(self): plot1 = Line_Dot(values = [math.sin(float(x)/10) * 1.9 + 4 for x in range(0, 62, 2)]) plot2 = Line_Dot(values = [math.sin(float(x)/10) * 1.9 + 7 for x in range(0, 62, 2)]) plot3 = Line_Dot(values = [math.sin(float(x)/10) * 1.9 + 10 for x in range(0, 62, 2)]) plot1.set_halo_size(0) plot2.set_halo_size(1) plot3.set_halo_size(3) plot1.set_width(1) plot2.set_width(2) plot3.set_width(6) plot1.set_dot_size(4) plot2.set_dot_size(4) plot3.set_dot_size(6) chart = openFlashChart.template("Line_Dot chart") chart.set_y_axis(min = 0, max = 15, steps = 5) chart.add_element(plot1) chart.add_element(plot2) chart.add_element(plot3) return chart.encode()