python 显示折现图

base.dbcomm db

json
com.business.common
com.business.common CommonUtil
matplotlib.pyplot plt
matplotlib.dates mdates
matplotlib.pylab pylab
pylab *
mpl.rcParams[] = [] mpl.rcParams[] = ProductInfo:

    getProductByCategoryCode(, categoryCode):
        getProductByCategoreCodeSQL = bigDict={};
        result = CommonUtil.getExcludeItemKeys()
        :
            conn = db.getLocalConn();
            conn.cursor() cur:
                cur.execute(getProductByCategoreCodeSQL, (categoryCode))
                row cur:
                    params=json.loads(row[])
                    itemKeyName params.keys():
                        (itemKeyName result):
                            ;
                        (itemKeyName bigDict.keys()):
                            itemvalue=params[itemKeyName]
                            bigDict[itemKeyName]={itemvalue:}
                        :
                            dict=bigDict[itemKeyName];
                            (params[itemKeyName] dict.keys()):
                                count=dict[params[itemKeyName]]+dict[params[itemKeyName]]=count
                                bigDict[itemKeyName]=dict
                            :
                                dict[params[itemKeyName]]=bigDict[itemKeyName] = dict
                bigDict
        :
            conn.close();


    get_productinfocount_by_categorycode(,category_code):
        get_product_info_by_category_code_sql = :
            conn = db.getLocalConn();
            conn.cursor() cur:
                cur.execute(get_product_info_by_category_code_sql, (category_code,));
                result = cur.fetchone()
        :
            conn.close();
        result[];


productInfo = ProductInfo();

dict=productInfo.getProductByCategoryCode()

itemKeyName dict.keys():
    dictChild=dict[itemKeyName]
    point_xx=(dictChild.keys());
    point_x=((dictChild.keys()))
    point_y=(dictChild.values());

    pylab.figure()
    x = ()
    pylab.xticks(point_x, point_xx)
    pylab.plot(point_x, point_y, )

    pylab.show()


你可能感兴趣的:(python 显示折现图)