﻿//MESSSKALA
$(document).ready(function () {
	var dataSource = #datasource#;
	Globalize.culture("de-DE");
	var types = ["splineArea", "stackedSplineArea", "fullStackedSplineArea"];

		var chartOptions = {
		title: "#title#",
		dataSource: {
            store: {
				data: dataSource,
				type: "array"#keyfield#
			}
		}, 		
		rotated: #rotated#,
		valueAxis: {
			label: {
				visible: #showaxis#,
				format: 'fixedPoint',
				precision: #precision#			
			}
		},
		commonSeriesSettings: {
			type: types[0],
			argumentField: "#argumentfield#",
			label: {
				visible: #showlabel#,
				format: "fixedPoint",
				precision: #precision#
			}
 		},
		argumentAxis:{
			valueMarginsEnabled: false
		},
		margin: {
			bottom: 20
		},
		series: #columns#,
		legend: {
			verticalAlignment: "bottom",
			horizontalAlignment: "center"
		},
		onPointClick: function(e){
			var prefix="#prefix#";
			if (prefix != ""){
				window.location.href = encodeURIComponent(prefix + "_" + e.target.argument) + ".html";
			}
		}		
	};

	var chart = $("#id#").dxChart(chartOptions).dxChart("instance");

	$("#types").dxSelectBox({
		dataSource: types,
		value: types[0],
		onValueChanged: function(e){
			chart.option("commonSeriesSettings.type", e.value);    
		}
	});
})