i suppose your question is high-level and in two parts. this is not a coding answer because your question is too high-level. we don't even know what type of back end you have access too.

gather your data this part has nothing to do with d3.js and is dependent upon your back end. you need to show the user an html form with the question and possible answers to your survey. the form will post to your back end (asynchronously, perhaps) and persist the answer in some sort of a data store (usually a database).

display your data you should have an endpoint in your web application for extracting the aggregate results from your survey. it should return the data in a form that can be read by javascript (json, perhaps?) so that you can reference it from your d3.js call to get the data. you can then use d3.js to display the data as a pie chart. if you have trouble writing your own pie chart, consider a boxed approach. you can also find examples of using the pie layout in d3.js.

if you can give us any more information, i'd be happy to expand upon this answer further.

Related Query

More Query from same tag