Is barring only the four top string (E, B, G, D) in playing barre chords wrong in both acoustic or electric guitar?
Most barre chords can be played using only the four highest strings, on either electric or acoustic. I would not label it as right or wrong to do it that way. If that is the way you choose to play the chords, then that is your decision. Perhaps there is a reason you prefer to play them that way.
As an example many people choose to play the F major chord in first position - using only the four top strings. But I prefer to play it as an E shaped Barre chord on all 6 strings. Either way it's an F major chord (and neither version is "wrong") - but adding the base notes gives it a fuller, richer sound in my opinion. Same holds true for all the other chords that can be played with 5 or six strings.
Many so called "power chords" are played using only two strings. Two string power chords sound better on an electric guitar with distortion to add more body to the sound of just two strings. The electronics can make a two string power chord sound really powerful (no pun intended). You can't really get the same effect on acoustic.
But playing the top four verses a 5 or 6 string version of a barre chord will work on either acoustic or electric.
Pictured below with his two and three string guitars - is a guy who only uses only two or 3 strings on his guitars, ukuleles, and banjos, but his accompaniment sounds just fine. His name is Casper Babypants and he takes at least half the tuning pegs off of all his guitars and plays with either two or three strings and he performs professionally. It works for him. If you play 4 strings you are playing more strings than he is.
Don't let anyone tell you it's wrong. Let your ear and your abilities determine which version you play.
In addition to the two excellent answers here already, there is generally only one sort of chord which actually needs a top 4 string barre - a minor 7th, named off the top string.A basic 'E7' shape could use a barre over all four, to produce the 7th part on the D string, although with an inversion like that, it can sound quite weak. Other chords can be played using the top 4, but there may be no purpose in barring all four. Take an 'A' shape chord - the 'barre' part is only on the top string. A C-shape chord would only need the top 3 barred.
Reiterating the content of the previous answers, three or four strings is sufficient for most chords - jazzers often prefer them - but adding full-blooded chords to your inventory is a great move, for variety if nothing else. Some songs need the one, others, the other.
Wrong and right in music is pretty blurred (thank goodness !), and the oft quoted "if it sounds good, it most likely is" is king.
I wouldn't say that it's wrong per se. There are many contexts where all you need is a few high notes.
But it's worthwhile learning to play a full barre chord across all six strings. It opens up many more possibilities for partial chords on the lower strings, middle strings, or even split with a few muted in the middle.
An electric guitar with a band of other musicians is more likely to get away with only partial barre chords. So it's less wrong on an electric IMO. But if you want to play that thing solo, some low chords or fuller chords (unless you're heavily distorted) are good to have ready.
"...a barre chord...is a type of guitar chord, where one or more fingers are used to press down multiple strings across the guitar fingerboard." (Wikipedia)
And, also from Wikipedia:
F F E-------------1---------------1--- B-------------1---------------1--- G-------------2---------------2--- D-------------3---------------3--- A-------------3------------------- E-------------1------------------- An F-shape "great bar" chord and an F-shape "small bar" chord.
I guess some people even call a triad like (1,1,2,x,x,x) "barred".
So, wrong is just the person who says that "barre" means your index finger presses down 5 or 6 strings at the same time.