plotting.py
def diff_price_fig(choosen_df):
    '''
    Make fugure Percent of Original List Price
    INPUT: dataframe
    OUTPUT: figure, plotly.graph_objects
    '''
    fig = go.Figure()
    price_diff = [p - 100 for p in choosen_df[
                    "Percent of Original List Price Received"
                ]]
    for m in set(choosen_df["Year"]):
        color = colors[m % 10]
        fig.add_trace(
            go.Bar(
                x=choosen_df["Month"],
                y=[p - 100 for p in choosen_df[choosen_df["Year"] == m][
                    "Percent of Original List Price Received"
                ]],
                name=m,
                text=m,
                texttemplate='%{text}<br>%{y}%', 
                textposition='outside',
                insidetextanchor="start",
                marker_color=color,
                showlegend=False,
                cliponaxis=False,
            )
        )
    fig.update_layout(
        barmode="group",
        title={
            "text": "Percent of Original List Price",
            "y": 0.9,
            "x": 0.5,
            "xanchor": "center",
            "yanchor": "top",
        },
    yaxis_title="Difference (%)",
    yaxis_range=[min(price_diff) - 3, max(price_diff) + 3]
)
    return fig

    Make fugure Percent of Original List Price
    INPUT: dataframe
    OUTPUT: figure, plotly.graph_objects
    
Make fugure Percent of Original List Price
INPUT: dataframe
OUTPUT: figure, plotly.graph_objects
Make fugure Percent of Original List Price INPUT : dataframe OUTPUT : figure plotly . graph_objects
def diff_price_fig(choosen_df):
    fig = go.Figure()
    price_diff = [p - 100 for p in choosen_df[
                    "Percent of Original List Price Received"
                ]]
    for m in set(choosen_df["Year"]):
        color = colors[m % 10]
        fig.add_trace(
            go.Bar(
                x=choosen_df["Month"],
                y=[p - 100 for p in choosen_df[choosen_df["Year"] == m][
                    "Percent of Original List Price Received"
                ]],
                name=m,
                text=m,
                texttemplate='%{text}<br>%{y}%', 
                textposition='outside',
                insidetextanchor="start",
                marker_color=color,
                showlegend=False,
                cliponaxis=False,
            )
        )
    fig.update_layout(
        barmode="group",
        title={
            "text": "Percent of Original List Price",
            "y": 0.9,
            "x": 0.5,
            "xanchor": "center",
            "yanchor": "top",
        },
    yaxis_title="Difference (%)",
    yaxis_range=[min(price_diff) - 3, max(price_diff) + 3]
)
    return fig
def diff_price_fig ( choosen_df ) : fig = go . Figure ( ) price_diff = [ p - 100 for p in choosen_df [ "Percent of Original List Price Received" ] ] for m in set ( choosen_df [ "Year" ] ) : color = colors [ m % 10 ] fig . add_trace ( go . Bar ( x = choosen_df [ "Month" ] , y = [ p - 100 for p in choosen_df [ choosen_df [ "Year" ] == m ] [ "Percent of Original List Price Received" ] ] , name = m , text = m , texttemplate = '%{text}<br>%{y}%' , textposition = 'outside' , insidetextanchor = "start" , marker_color = color , showlegend = False , cliponaxis = False , ) ) fig . update_layout ( barmode = "group" , title = { "text" : "Percent of Original List Price" , "y" : 0.9 , "x" : 0.5 , "xanchor" : "center" , "yanchor" : "top" , } , yaxis_title = "Difference (%)" , yaxis_range = [ min ( price_diff ) - 3 , max ( price_diff ) + 3 ] ) return fig
Make fugure Percent of Original List Price
INPUT: dataframe
OUTPUT: figure, plotly.graph_objects
Make fugure Percent of Original List Price INPUT : dataframe OUTPUT : figure plotly . graph_objects
'''
    Make fugure Percent of Original List Price
    INPUT: dataframe
    OUTPUT: figure, plotly.graph_objects
    '''
choosen_df