What happened

GPS device specialist Garmin (NYSE:GRMN) gained 23% to modestly outperform a broader stock market that rose 19% in 2017, according to data provided by S&P Global Market Intelligence.

^SPX Chart

^SPX data by YCharts.

That rally extended an impressive 2016, during which Garmin's stock soared 31%.

So what

Garmin delivered solid sales and profit results throughout the year, but its third-quarter announcement really showed off the power of its diverse product lineup. Despite weakness in its fitness and automotive categories, overall revenue rose 3% thanks to growth in its outdoor, marine, and aviation segments. Gross profit margin improved to 58% as well, as many of its new product introductions found traction in the market.

A jogger interacts with her smartwatch.

Image source: Getty Images.

Those results stand in stark contrast to Fitbit (NYSE:FIT), which has a much narrower product lineup that's dependent on just a few offerings. Fitbit's revenue fell 35% over the first three quarters, and its gross margin declined to 42% of sales from 45% in the prior-year period.

Now what

Like Fitbit has, Garmin noticed more weakness in its fitness wearables division heading into the key holiday quarter. Thus, management now sees that segment shrinking by 7% for the full year. However, its other categories are expected to more than offset that decline, leading to another year of higher annual sales and profits driven by Garmin's successful diversification initiative.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.