Of course any sort of violence towards any elected official is unacceptable, however i'm not remotely surprised it happened.
AfD came into being from it's power base in Eastern Germany, many of it's founders and original supporters are self professed Nazi's. Not just far right by UK standards but proper, Germany for white people bring back the fatherland types. They started to get more and more traction in local elections purely on their anti-immigration stance. Many cities in the East have had years of protests by Right Wing parties, in particular Leipzig and Dresden. The early protests amounted to a few thousand but they were quickly out-numbered by counter protests. It often got violent. In Leipzig there is a massive Left Wing community who are full on socialists who do not accept capitalism and believe there should be open borders to all etc etc. The two got together and riots ensued.
This was a few years ago and now there are hardly any protests.
Many of the people who vote for them, are in areas that have little to no immigration or those areas felt left behind and not having the same financial success of the rest of the country (sound familar?). Saxony is something like 95% white, the rest is of Turkish ancestry with some Vietnamese, Chinese. I would say there is 1% of African / Caribbean / Middle East descent. When you have far right parties pushing extreme views, pushing protests in full on left wing neighbourhoods something will give.
This gets little coverage in UK press but there are serious problems in East Germany with these two groups. Of course the majority of people are fairly left of centre of their political opinions as most Germany are and most have little problem with the immigration that was seen, and accept Germany's place in Europe and what it's responsibilities are.
AfD does have support in the rest of Germany now but it's low double digit percentage. Hopefully they will fade away and more centrist forces come back into play.