basefunctions/plot_preprocessor.py
def plotdata(self):
        '''Loop for plotting data according to the defined plotting types'''
        for element_name in self.plot_elements:
            #plot loop for every element in plot_elements including savecent, cashbook and holiday
            #every element has its own plot selection saved in plotting choice. Basic choice contains month plot and cost plot
            plot_selection = self.plotting_choice[element_name]
            file_resultpath = self.folder_res[element_name]+self.folder_sep
            ##Plot selection
            ###Plot basic choice (monthplot and costplot)

            #Month plot
            self.plotsplitter(element_name, 'monthplot')

            #Categorical cost plot

            self.plotsplitter(element_name, 'costplot')

            ###Plot normal choice (basic choice + box & violinplot)

            if plot_selection in('normal', 'complete'):

                #Boxplot
                #copy data for possible plot slicing

                box_vioplot_data = self.basis_data[element_name].copy()
                box_vioplot_data = box_vioplot_data.sort_values(['cat']).reset_index()#sort by categories
                #create plotinfo
                self.plotinfo_boxplot[element_name] = [(box_vioplot_data, eval(f"f'''{LANGDICT_PLOTPROC['boxplot_info'][0]}'''"), file_resultpath+LANGDICT_PLOTPROC['boxplot_info'][1])]
                self.plotsplitter(element_name, 'boxplot')

                #Violinplot
                #use same dataframe as for boxplots
                self.plotinfo_vioplot[element_name] = [(box_vioplot_data, eval(f"f'''{LANGDICT_PLOTPROC['vioplot_info'][0]}'''"), file_resultpath+LANGDICT_PLOTPROC['vioplot_info'][1])]
                self.plotsplitter(element_name, 'vioplot')

                #since longterm data might fail with those plots a try-except-function is established
                try:
                    #Pie charts
                    for pie_entry in self.plotinfo_piechart[element_name]:
                        plotters.pieplotter(pie_entry, self.month_data[element_name])

                    if plot_selection == 'complete':
                    #complete plot includes top3 overview

                        plotinfo_overview = (eval(f"f'''{LANGDICT_PLOTPROC['overviewplot_plotinfo'][0]}'''"), LANGDICT_PLOTPROC['overviewplot_plotinfo'][1], LANGDICT_PLOTPROC['overviewplot_plotinfo'][2], file_resultpath+LANGDICT_PLOTPROC['overviewplot_plotinfo'][3])
                        plotters.overviewplot(self.top3[element_name], self.top3_adj[element_name], self.month_data[element_name], plotinfo_overview)

                    else:
                        pass
                except:
                    pass



            else:
                pass
Loop for plotting data according to the defined plotting types
Loop for plotting data according to the defined plotting types
Loop for plotting data according to the defined plotting types
def plotdata(self):
        for element_name in self.plot_elements:
            plot_selection = self.plotting_choice[element_name]
            file_resultpath = self.folder_res[element_name]+self.folder_sep
            self.plotsplitter(element_name, 'monthplot')
            self.plotsplitter(element_name, 'costplot')
            if plot_selection in('normal', 'complete'):
                box_vioplot_data = self.basis_data[element_name].copy()
                box_vioplot_data = box_vioplot_data.sort_values(['cat']).reset_index()
                self.plotinfo_boxplot[element_name] = [(box_vioplot_data, eval(f"f'''{LANGDICT_PLOTPROC['boxplot_info'][0]}'''"), file_resultpath+LANGDICT_PLOTPROC['boxplot_info'][1])]
                self.plotsplitter(element_name, 'boxplot')
                self.plotinfo_vioplot[element_name] = [(box_vioplot_data, eval(f"f'''{LANGDICT_PLOTPROC['vioplot_info'][0]}'''"), file_resultpath+LANGDICT_PLOTPROC['vioplot_info'][1])]
                self.plotsplitter(element_name, 'vioplot')
                try:
                    for pie_entry in self.plotinfo_piechart[element_name]:
                        plotters.pieplotter(pie_entry, self.month_data[element_name])
                    if plot_selection == 'complete':
                        plotinfo_overview = (eval(f"f'''{LANGDICT_PLOTPROC['overviewplot_plotinfo'][0]}'''"), LANGDICT_PLOTPROC['overviewplot_plotinfo'][1], LANGDICT_PLOTPROC['overviewplot_plotinfo'][2], file_resultpath+LANGDICT_PLOTPROC['overviewplot_plotinfo'][3])
                        plotters.overviewplot(self.top3[element_name], self.top3_adj[element_name], self.month_data[element_name], plotinfo_overview)
                    else:
                        pass
                except:
                    pass
            else:
                pass
def plotdata ( self ) : for element_name in self . plot_elements : plot_selection = self . plotting_choice [ element_name ] file_resultpath = self . folder_res [ element_name ] + self . folder_sep self . plotsplitter ( element_name , 'monthplot' ) self . plotsplitter ( element_name , 'costplot' ) if plot_selection in ( 'normal' , 'complete' ) : box_vioplot_data = self . basis_data [ element_name ] . copy ( ) box_vioplot_data = box_vioplot_data . sort_values ( [ 'cat' ] ) . reset_index ( ) self . plotinfo_boxplot [ element_name ] = [ ( box_vioplot_data , eval ( f"f'''{LANGDICT_PLOTPROC['boxplot_info'][0]}'''" ) , file_resultpath + LANGDICT_PLOTPROC [ 'boxplot_info' ] [ 1 ] ) ] self . plotsplitter ( element_name , 'boxplot' ) self . plotinfo_vioplot [ element_name ] = [ ( box_vioplot_data , eval ( f"f'''{LANGDICT_PLOTPROC['vioplot_info'][0]}'''" ) , file_resultpath + LANGDICT_PLOTPROC [ 'vioplot_info' ] [ 1 ] ) ] self . plotsplitter ( element_name , 'vioplot' ) try : for pie_entry in self . plotinfo_piechart [ element_name ] : plotters . pieplotter ( pie_entry , self . month_data [ element_name ] ) if plot_selection == 'complete' : plotinfo_overview = ( eval ( f"f'''{LANGDICT_PLOTPROC['overviewplot_plotinfo'][0]}'''" ) , LANGDICT_PLOTPROC [ 'overviewplot_plotinfo' ] [ 1 ] , LANGDICT_PLOTPROC [ 'overviewplot_plotinfo' ] [ 2 ] , file_resultpath + LANGDICT_PLOTPROC [ 'overviewplot_plotinfo' ] [ 3 ] ) plotters . overviewplot ( self . top3 [ element_name ] , self . top3_adj [ element_name ] , self . month_data [ element_name ] , plotinfo_overview ) else : pass except : pass else : pass
Loop for plotting data according to the defined plotting types
Loop for plotting data according to the defined plotting types
'''Loop for plotting data according to the defined plotting types''' #plot loop for every element in plot_elements including savecent, cashbook and holiday #every element has its own plot selection saved in plotting choice. Basic choice contains month plot and cost plot ##Plot selection ###Plot basic choice (monthplot and costplot) #Month plot #Categorical cost plot ###Plot normal choice (basic choice + box & violinplot) #Boxplot #copy data for possible plot slicing #sort by categories #create plotinfo #Violinplot #use same dataframe as for boxplots #since longterm data might fail with those plots a try-except-function is established #Pie charts #complete plot includes top3 overview
self