The first one is right but a little wordy and the "a portion of" does not belong. The second answer sounds like it is connected to something else, possibly not the blue bar.
The first alternative that comes to mind:
The green bar touches the blue bar near its right edge.
I prefer "touches" instead of "is connected to," although they are both valid. The latter kind of connotes that there may be something connecting the two, like glue or a latch. The former implies that if you pull on the green bar, the two will come apart and tends to get used with graphics like this.
Here "its" should refer to the most recently mentioned noun, which is the blue bar. Some people may still get confused about what "its" refers to even though the grammar is unambiguous. If this is a technical manual or other location where clarity is more important than brevity, you might consider something like
The upper edge of the green bar touches the bottom edge of the blue bar near the latter's right edge.