function amchart_config (chart, type, settings) {
	chart.fontFamily = 'Tahoma, sans-serif';
	chart.borderAlpha = 1;
	chart.marginLeft = 60;
	chart.marginTop = 40;
	chart.marginRight = 60;
	chart.marginBottom = 30;
	chart.numberFormatter = {decimalSeparator:',',thousandsSeparator: ' ', precision: -1};
	var type_config = 'amchart_config_' + type + '(chart)';

	eval(type_config);
	eval(settings);

	var legend = chart.legend;
	if (legend) {
		legend.marginTop = 0;
		legend.marginBottom = 0;
		legend.fontSize = 12;
		legend.rollOverColor = '#000000';
	}
	var labelCount = chart.allLabels.length;
	for (var i = 0; i < labelCount; i ++) {
		var label = chart.allLabels[i];
		label.bold = true;
		if (label.rotation) {
			if (label.x == 0) {
				label.x = 5;
			} else if (label.x != 0) {
				label.x = '!5';
			}
		}
	}

	chart.validateNow();
}

function amchart_config_column (chart) {
	chart.columnWidth = 0.8;
	chart.columnSpacing = 15;
	chart.depth3D = 10;
	chart.angle = 20;
	chart.marginTop = 44;
	chart.marginRight = 69;
}

function amchart_config_pie (chart) {
	chart.innerRadius = 10;
	chart.height = 5;
	chart.angle = 40;
	chart.pieBrightnessStep = 40;
	chart.hoverAlpha = 1; 
	chart.radius = 150;
	chart.pullOutDuration = 0.5;
	chart.pullOutEffect = 'backOut'; 
	chart.pullOutOnlyOne = true;
	chart.labelText = '[[title]]: [[percents]]%';
	chart.groupedPercent = 3;
	chart.groupedTitle = 'Прочие';
	chart.groupedColor = '#999999';
}

function amchart_config_line (chart) {}

