def generate_chart(data: pd.DataFrame) -> Line: line_chart = Line( js=(), # The tooltips are really nice, but I don't want any JS. style=GruvboxStyle, x_label_rotation=30) # Water those datetimes down so they don't overlap and we can read them! datetimes = data['Datetime'] dilution_factor = datetimes.shape[0] // 10 datetimes = dilute_datetimes(datetimes, factor=dilution_factor) line_chart.title = 'HTTP GET by IP vs. HTTP GET by Hostname' line_chart.y_title = 'Seconds' line_chart.x_labels = datetimes line_chart.add(title='By IP', values=data['Seconds for HTTP GET by IP']) line_chart.add(title='By Hostname', values=data['Seconds for HTTP GET by Hostname']) return line_chart
def plot_disp(self): s1, s2, s3, x = self.badanie.plotdata() chart = Line() chart.x_title = 'Czas' chart.y_title = 'Ugięcie' # chart.title = 'Wykres ugięcia gruntu przy badaniu' chart.x_labels = map(str, x) chart.x_labels_major_count = 20 chart.show_minor_x_labels = False chart.x_label_rotation = 60 chart.add('Zrzut 1', s1) chart.add('Zrzut 2', s2) chart.add('Zrzut 3', s3) chart.render(is_unicode=True) plotpath = 'plots/plot.svg' chart.render_to_file(plotpath) ploturl = "file:///home/macwojs/PycharmProjects/Terratest/" + plotpath self.main_screen.plotview.load(QUrl(ploturl))