Most chocolate bars have trans fat, usually less than 1g per 100g of chocolate. Even dark chocolate and even expensive brands such as Lindt. Where is this trans fat coming from?
Short answer: I'd look at the ingredient list. If any sort of partially hydrogenated oil or random fats appear, they are the likely source. If not, I'd look to see if the chocolate contains cow's milk or butter (sometimes labeled "milkfat" or "butter oil" on chocolate ingredients), since that may also be a small source of trans fat. Almost all oils/fats, even cocoa butter, will contain trace amounts of trans fat. Processing can affect amounts of trans fat too, since heating fats will cause large fat chains in molecules to move and sometimes convert to trans versions.
There are trace amounts of trans fat found in most oils. Labeling laws tend to make this issue confusing, as in the U.S. where FDA regulations allow nutritional labeling to state "0 grams" when the amount per serving is less than 0.5 grams. (In fact, that link implies that manufacturers are actually required to state "0g" when the amount is less than 0.5 grams per serving, presumably rather than saying "0.1g" or whatever. I don't know if that's true.)
A decade or more ago, many foods (including chocolate) often contained significant amounts of partially hydrogenated oils (often as high as 50% trans fats by weight). Many US manufacturers have since dropped the usage of hydrogenated oils or lowered the amounts so that the serving size ends up under the 0.5g threshold for reporting.
Chocolate may still sometimes contain partially hydrogenated oils, which may be the source for trans fat in some brands. However, when you're talking about amounts like 1g or less per 100g of chocolate, there are plenty of other possible sources. For example, cow's milk contains small but not insignificant amounts of trans fats, as does butter (about 5% trans fat). This is true of all milk and meat from ruminants. You may not know it from many labels, because the serving size may fall below the reporting threshold, but it is there.
Moreover, it's important to note than "trans fat" is a very general chemical category. While the majority of added trans fats in processed foods are regarded as problematic, there are natural trans fats (such as those found in milk) which do not have the same effects on humans. One notable example is conjugated linoleic acid, naturally found in ruminant milk (in both cis and trans fat forms), which some claim actually has beneficial effects.
So when you see a trace amount of trans fat showing up from milk or butter as an ingredient, it may not have the same stigma as the "partially hydrogenated" types of trans fats. I would assume this may be one reason behind the FDA's rule about trans fat labeling: putting tiny amounts of trans fat would show all of these random trans fats (some of which are thought to be harmful, some perhaps even beneficial) in all sorts of foods. The "bad" trans fats from partially hydrogenated oils were the main target of the regulation. (Some countries only require labeling for trans fats which come from "artificial" or "industrial processed" ingredients.)
Again, the chemical composition of most oils/fats have some trace amounts of trans fats. (See the table in this pamphlet from a chocolate manufacturer.) Even cocoa butter has some tiny amount like 0.1g of trans fat per 100g. That's unlikely to be significant source of trans fat in a chocolate bar, but if you're measuring tiny amounts (as asked in the question), it's a possible contributor to a fraction of a gram amount in a large chocolate bar.