Beispiel #1
0
def draw_industry_is_cfs_bs_subplot(ax, df, x):
    width = 0.10
    # cfs var

    stock_code = df['stock_code']
    stock_name = df['stock_name_cfs']
    bizcashinfl = df['bizcashinfl']
    bizcashoutf = df['bizcashoutf']
    mananetr = df['mananetr']

    invcashinfl = df['invcashinfl']
    invcashoutf = df['invcashoutf']
    invnetcashflow = df['invnetcashflow']

    fincashinfl = df['fincashinfl']
    fincashoutf = df['fincashoutf']
    finnetcflow = df['finnetcflow']

    # is var
    t = df['enddate']
    bti = df['biztotinco']
    bi = df['bizinco']
    inteinco = df['inteinco']
    pouninco = df['pouninco']
    otherbizinco = df['otherbizinco']
    btc = df['biztotcost']
    bc = df['bizcost']
    pp = df['perprofit']
    biztax = df['biztax']
    salesexpe = df['salesexpe']
    manaexpe = df['manaexpe']
    finexpe = df['finexpe_is']
    asseimpaloss = df['asseimpaloss']
    inveinco = df['inveinco']
    nonoreve = df['nonoreve']
    nonoexpe = df['nonoexpe']
    noncassetsdisl = df['noncassetsdisl']
    incotaxexpe = df['incotaxexpe']
    netprofit = df['netprofit_is']

    # bs vars
    t = df['reportdate']
    a = df['totalassets']
    ca = df['totalcurrentassets']
    la = df['totalnoncassets']

    b = df['totliabsharequi']
    cl = df['totalcurrliab']
    ll = df['totalnoncliab']
    l = df['totliab']
    e = df['righaggr']

    if x == 'stock_code':
        ind = np.arange(len(stock_name))  # the x locations for the groups
    else:
        ind = np.arange(len(t))

    # bar1 inco
    # btib = ax.bar(ind, bti, width*8,color='silver')

    # bar 2 inco
    bar2_position = ind - width * 4
    is_chart.draw_is_income_bar(ax, bar2_position, width * 6, bi, otherbizinco,
                                inveinco, pouninco, inteinco)

    # bar 3 co
    # bar3_position=ind - 3 * width
    # rects3 = ax.bar(bar3_position, btc, width, bottom=pp,color='blue')

    # bar 4 co

    bar4_position = ind - 1.5 * width - width * 4
    is_chart.draw_is_cost_bar(ax, bar4_position, width * 2, bc, biztax,
                              salesexpe, manaexpe, finexpe, asseimpaloss, pp)

    # bar 6 co
    bar5_position = bar4_position
    is_chart.draw_is_net_profit_bar(ax, bar5_position, width, nonoreve,
                                    nonoexpe, noncassetsdisl, incotaxexpe,
                                    netprofit)
    # cfs bars
    bar6_position = ind + 1.5 * width - width * 4
    cfs_chart.draw_cfs_biz_cash_bar(ax, bar6_position, width * 2, bizcashinfl,
                                    bizcashoutf, mananetr)

    # bs bars
    bs_position = ind
    bs_chart.draw_bs_bars(ax, bs_position, width, ca, la, cl, ll, e)
    ax.set_xticks(ind)
    font = FontProperties(fname=r"C:\\windows\\fonts\\simsun.ttc",
                          size='xx-large')
    if x == 'stock_code':
        ax.set_xticklabels(stock_code + "_" + stock_name,
                           size='xx-large',
                           rotation=90,
                           fontproperties=font)
    else:
        ax.set_xticklabels(t,
                           size='xx-large',
                           rotation=90,
                           fontproperties=font)
    ax.legend(loc='upper left')
def draw_industry_is_cfs_bs_subplot(ax, df, x, str_stock_code=''):
    width = 0.10
    # cfs var
    if str_stock_code == '':
        stock_code = df['stock_code']
        stock_name = df['stock_name_cfs']
    bizcashinfl = df['sub_total_of_ci_from_oa']
    bizcashoutf = df['sub_total_of_cos_from_oa']
    mananetr = df['ncf_from_oa']

    invcashinfl = df['sub_total_of_ci_from_ia']
    invcashoutf = df['sub_total_of_cos_from_ia']
    invnetcashflow = df['ncf_from_ia']

    fincashinfl = df['sub_total_of_ci_from_fa']
    fincashoutf = df['sub_total_of_cos_from_fa']
    finnetcflow = df['ncf_from_fa']

    # is var
    t = df['report_date_str_is']
    # bti = df['biztotinco']
    sr = df['total_revenue']
    inteinco = df['invest_income']
    pouninco = df['exchg_gain']
    otherbizinco = df['other_income']
    # btc = df['biztotcost']
    bc = df['operating_cost']
    biztax = df['operating_taxes_and_surcharge']
    salesexpe = df['sales_fee']
    manaexpe = df['manage_fee']
    finexpe = df['financing_expenses']
    asseimpaloss = df['asset_impairment_loss']
    inveinco = df['invest_income']
    other_income = df['other_income']
    finance_cost_interest_income = df['finance_cost_interest_income']
    asset_disposal_income = df['asset_disposal_income']
    rad_cost = df['rad_cost']
    credit_impairment_loss = df['credit_impairment_loss']
    # -------------
    op = df['op']
    nonoinco = df['non_operating_income']
    nonopayo = df['non_operating_payout']
    # noncassetsdisl = df['noncurrent_assets_dispose_gain']
    # ---------------
    profit_total_amt = df['profit_total_amt']
    incotaxexpe = df['income_tax_expenses']
    netprofit = df['net_profit']

    # bs vars
    t = df[x]
    a = df['total_assets']
    ca = df['total_current_assets']
    ar = df['account_receivable']
    inventory = df['inventory']
    la = df['total_noncurrent_assets']

    goodwill = df['goodwill']
    b = df['total_liab_and_holders_equity']
    cl = df['total_current_liab']
    ll = df['total_noncurrent_liab']
    l = df['total_liab']
    e = df['total_holders_equity']
    shares = df['shares']

    if x == 'stock_code':
        ind = np.arange(len(stock_name))  # the x locations for the groups
    else:
        ind = np.arange(len(t))

    # bar1 inco
    # btib = ax.bar(ind, bti, width*8,color='silver')

    # bar 2 inco
    bar2_position = ind - width * 4
    is_chart.draw_is_income_bar(ax, bar2_position, width * 6, sr, inveinco,
                                finance_cost_interest_income,
                                asset_disposal_income, other_income)

    # bar 3 co
    # bar3_position=ind - 3 * width
    # rects3 = ax.bar(bar3_position, btc, width, bottom=pp,color='blue')

    # bar 4 co

    bar4_position = ind - 1.5 * width - width * 4
    is_chart.draw_is_cost_bar(ax, bar4_position, width * 2, bc, biztax,
                              salesexpe, manaexpe, finexpe, rad_cost,
                              asseimpaloss, credit_impairment_loss, op)

    # bar 6 profit total amount
    bar5_position = bar4_position
    is_chart.draw_is_net_profit_bar(ax, bar5_position, width, profit_total_amt,
                                    nonoinco, nonopayo, incotaxexpe, netprofit)
    # cfs bars
    bar6_position = ind + 1.5 * width - width * 4
    cfs_chart.draw_cfs_biz_cash_bar(ax, bar6_position, width * 2, bizcashinfl,
                                    bizcashoutf, mananetr)

    # bs bars
    bs_position = ind
    bs_chart.draw_detailed_bs_bars(ax, bs_position, width, ca, ar, inventory,
                                   la, goodwill, cl, ll, e, shares)
    ax.set_xticks(ind)
    # font = FontProperties(fname=r"C:\\windows\\fonts\\simsun.ttc",size='xx-large')
    # if x=='stock_code':
    #     ax.set_xticklabels(stock_code+"_"+stock_name, size='xx-large', rotation=90, fontproperties=font)
    # else:
    #     ax.set_xticklabels(t, size='xx-large', rotation=90, fontproperties=font)
    if x == 'stock_code':
        ax.set_xticklabels(stock_code + "_" + stock_name,
                           size='xx-large',
                           rotation=90)
    else:
        ax.set_xticklabels(t, size='xx-large', rotation=90)
    ax.legend(loc='upper left')
Beispiel #3
0
def draw_industry_is_cfs_subplot(ax,df):
    width = 0.12
    # cfs var

    stock_code = df['stock_code']
    stock_name = df['stock_name_cfs']
    bizcashinfl = df['bizcashinfl']
    bizcashoutf = df['bizcashoutf']
    mananetr = df['mananetr']

    invcashinfl = df['invcashinfl']
    invcashoutf = df['invcashoutf']
    invnetcashflow = df['invnetcashflow']

    fincashinfl = df['fincashinfl']
    fincashoutf = df['fincashoutf']
    finnetcflow = df['finnetcflow']




    # is var
    t = df['enddate']
    bti = df['biztotinco']
    bi = df['bizinco']
    inteinco = df['inteinco']
    pouninco = df['pouninco']
    otherbizinco = df['otherbizinco']
    btc = df['biztotcost']
    bc = df['bizcost']
    pp = df['perprofit']
    biztax = df['biztax']
    salesexpe = df['salesexpe']
    manaexpe = df['manaexpe']
    finexpe = df['finexpe_is']
    asseimpaloss = df['asseimpaloss']
    inveinco = df['inveinco']
    nonoreve = df['nonoreve']
    nonoexpe = df['nonoexpe']
    noncassetsdisl = df['noncassetsdisl']
    incotaxexpe = df['incotaxexpe']
    netprofit = df['netprofit_is']

    ind = np.arange(len(t))  # the x locations for the groups

    # bar1 inco
    # btib = ax.bar(ind, bti, width*8,color='silver')

    # bar 2 inco
    bar2_position=ind
    is_chart.draw_is_income_bar(ax,bar2_position,width*6,bi,otherbizinco,inveinco,pouninco,inteinco)

    # bar 3 co
    # bar3_position=ind - 3 * width
    # rects3 = ax.bar(bar3_position, btc, width, bottom=pp,color='blue')

    # bar 4 co

    bar4_position=ind -1.5 * width
    is_chart.draw_is_cost_bar(ax, bar4_position, width * 2, bc, biztax, salesexpe, manaexpe, finexpe, asseimpaloss, pp)


    # bar 6 co
    bar5_position = bar4_position
    is_chart.draw_is_net_profit_bar(ax, bar5_position, width, nonoreve, nonoexpe, noncassetsdisl, incotaxexpe,
                                    netprofit)
    # cfs bars
    bar6_position=ind+1.5*width
    cfs_chart.draw_cfs_biz_cash_bar(ax, bar6_position, width * 2, bizcashinfl, bizcashoutf, mananetr)

    ax.set_xticks(ind )
    font = FontProperties(fname=r"C:\\windows\\fonts\\simsun.ttc")
    ax.set_xticklabels(stock_name, size='small', rotation=90, fontproperties=font)
    ax.legend(loc='upper right')