$(document).ready(function () {
	dataSource = #dataSource#;
	Globalize.culture("de-DE");
	$("#id#").dxPieChart({
		type: "#pietype#",
		legend: {
        		visible: #showlegend#
    		},
		dataSource: {
            store: {
				data: dataSource,
				type: "array"#keyfield#
			}
		}, 
		series: [
			{
				argumentField: "#argumentfield#",
				valueField: "#valuefield#",
				label: {
					visible: #showlabel#,
					format: 'fixedPoint',
					precision: #precision#,
					connector: {
						visible: true,
						width: 1
					}#customize#
				}
			}
		],
		title: "#title#",
		onPointClick: function (e) {
			var point = e.target;

			toggleVisibility(point);
		},
		onLegendClick: function (e) {
			var arg = e.target;

			toggleVisibility(this.getAllSeries()[0].getPointsByArg(arg)[0]);
		},
		onPointClick: function(e){
			var prefix="#prefix#";
			if (prefix != ""){
				window.location.href = encodeURIComponent(prefix + "_" + e.target.argument) + ".html";
			}
		}		
	});

	function toggleVisibility(item) {
		item.isVisible() ? item.hide() : item.show();
	}
})