Food costs are still going up, and the trend has been hard on the profits of companies that sell food products. Here's a look at the earnings trend this year for some of the major companies that are dependent on products like wheat, corn, meat, and seafood.

SYSCO Corporation Earnings per Share Stock Chart by YCharts

That lone line upward belongs to Sysco (NYSE: SYY), a company that supplies food to restaurants, hotels, hospitals, universities, and other places people eat outside their homes. With about a 17% share of the market, Sysco is by far the largest company in this business.

While Sysco doesn't sell products directly to consumers like Kraft (NYSE: KFT) or Heinz (NYSE: HNZ), it faces the same need pass on rising food costs to struggling customers. It's not an easy task, considering neither consumers nor restaurants have a lot of extra cash at the moment. A lot of food suppliers have been too worried about losing sales to roll out wide-spread price hikes. It's especially difficult for packaged goods makers to raise prices when their largest customer tends to be Wal-Mart (NYSE: WMT).

But Sysco appears to have the worst of this distasteful task behind it. The company raised prices earlier this year, and the move immediately helped the bottom line. Paired with internal cost cuts, earnings soared. Much to the surprise of many, it didn't hurt sales. Comparable revenues rose 9.1% year-over-year. Overall sales gains were great.

SYSCO Corporation Revenues Stock Chart by YCharts

It probably helped that Sysco's customer base is thousands of businesses, with no one client making up more than 10% of its sales. Losing one customer to price increases isn't the death of Sysco. The gains in prices are helping gross profit margins also began to recover.

SYSCO Corporation Gross Profit Margin Stock Chart by YCharts

Sysco's price increases so far didn't fully offset its higher cost of business. In large part, they represent only what Sysco's customers were willing to swallow before their own businesses see sustained recoveries. When overall economic conditions improve, Sysco is expected to raise prices further. Paired with internal restructuring that will cut its production costs, the profit margin is expected to improve again.

Investors ramped up Sysco shares after quarterly earnings released in May proved the success of its pricing strategy. They have dropped some with the overall market.

SYSCO Corporation Price Stock Chart by YCharts

YCharts Pro pegs Sysco shares as attractive. The charts give Sysco perfect scores on fundamentals, in part because of a long history of cash, earnings growth and shareholder returns. Sysco has one of the better returns on equity records among both food wholesalers and retailers. Sysco shares' dividend yield is now 3.4%.

With food prices still rising to rise, and its customers continuing to struggle, Sysco's bottom line is hardly safe from erosion. But the fact that customers are sticking with Sysco now, despite price increases while money is still tight, is a good sign for Sysco's future. It's not nearly as hard to ask for price increases from customers whose orders are growing.

Dee Gill is an editor for the YCharts Pro Investor Service which includes professional stock charts, stock ratings and portfolio strategies.