<commit_before>var chartData = [];
$(document).on("dataAcquired",function(){
    
    AmCharts.makeChart("chartdiv1",
				{
					"type": "serial",
					"pathToImages": "http://cdn.amcharts.com/lib/3/images/",
					"categoryField": "category",
					"startDuration": 1,
					"categoryAxis": {
						"gridPosition": "start"
					},
					"trendLines": [],
					"graphs": [
						{
							"balloonText": "[[title]] of [[category]]:[[value]]",
							"fillAlphas": 1,
							"id": "AmGraph-1",
							"title": "graph 1",
							"type": "column",
							"valueField": "value"
						}
					],
					"guides": [],
					"valueAxes": [
						{
							"id": "ValueAxis-1",
							"title": "Axis title"
						}
					],
					"allLabels": [],
					"balloon": {},
					"legend": {
						"useGraphSettings": true
					},
					"titles": [
						{
							"id": "Title-1",
							"size": 15,
							"text": "Chart Title"
						}
					],
					"dataProvider": chartData[0]
				}
			);

	AmCharts.makeChart("chartdiv2",
				{
					"type": "pie",
					"pathToImages": "http://cdn.amcharts.com/lib/3/images/",
					"angle": 12,
					"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
					"depth3D": 15,
					"innerRadius": "40%",
					"titleField": "category",
					"valueField": "column-1",
					"allLabels": [],
					"balloon": {},
					"legend": {
						"align": "center",
						"markerType": "circle"
					},
					"titles": [],
					"dataProvider": [
						{
							"category": "category 1",
							"column-1": 8
						},
						{
							"category": "category 2",
							"column-1": 6
						},
						{
							"category": "category 3",
							"column-1": 2
						}
					]
				}
			);
    AmCharts.makeChart("chartdiv3",
				{
					"type": "gauge",
					"pathToImages": "http://cdn.amcharts.com/lib/3/images/",
					"theme": "default",
					"arrows": [
						{
							"id": "GaugeArrow-1"
						}
					],
					"axes": [
						{
							"bottomText": "0 km/h",
							"bottomTextYOffset": -20,
							"endValue": 220,
							"id": "GaugeAxis-1",
							"valueInterval": 10,
							"bands": [
								{
									"color": "#00CC00",
									"endValue": 90,
									"id": "GaugeBand-1",
									"startValue": 0
								},
								{
									"color": "#ffac29",
									"endValue": 130,
									"id": "GaugeBand-2",
									"startValue": 90
								},
								{
									"color": "#ea3838",
									"endValue": 220,
									"id": "GaugeBand-3",
									"innerRadius": "95%",
									"startValue": 130
								}
							]
						}
					],
					"allLabels": [],
					"balloon": {},
					"titles": [
						{
							"id": "Title-1",
							"size": 15,
							"text": "Speedometer"
						}
					]
				}
			);
});

var opts = {
    url:"http://37.139.4.54/tfoms/MDX",
    type:"POST",
    data:{
        MDX:'SELECT {CROSSJOIN([SEXNAM].[H1].[SEXNAM].Members,%LABEL(CROSSJOIN(,{%LABEL([Measures].[%COUNT],"Всего",""),%LABEL([daysWaitingOverStandard].[H1].[daysWaiting].&[Дольше 30 дней],"> 30 дней","",,"background:rgb(255, 208, 208);summary:sum;")}),"Число пациентов","")),%LABEL(CROSSJOIN(,%LABEL(CROSSJOIN(,{%LABEL([Measures].[%COUNT],"Всего",""),%LABEL([daysWaitingOverStandard].[H1].[daysWaiting].&[Дольше 30 дней],"> 30 дней","",,"background:rgb(255, 208, 208);"),%LABEL([Measures].[daysWaiting],"","",,"summary:avg;")}),"Число пациентов","")),"ИТОГО","")} ON 0,NON EMPTY HEAD([ProfileMODep].[H1].[Profile].Members,15) ON 1 FROM [QueueCube] %FILTER [status].[H1].[status].&[0]'
    },
    username:"_SYSTEM",
    password:"<PASSWORD>",
    success: function( data ) {
        console.log(data);
        if(data) { 
            var data = JSON.parse(data) || data;
            var transformedData = [];
            for(var i=0;i<data.axes[0].tuples.length;i++) {
                transformedData.push({
                    category:data.axes[0].tuples[i].caption,
                    value:data.cells[i]
                });
            }
            chartData.push(transformedData);
        }
        $(document).trigger("dataAcquired");
        return 1;
    }
}
$.ajax( opts );<commit_msg>Added real data to second and third charts<commit_after>var chartData = [];
$(document).on("dataAcquired0",function(){
    
    AmCharts.makeChart("chartdiv1",
				{
					"type": "serial",
					"pathToImages": "http://cdn.amcharts.com/lib/3/images/",
					"categoryField": "category",
					"startDuration": 1,
					"categoryAxis": {
						"gridPosition": "start"
					},
					"trendLines": [],
					"graphs": [
						{
							"balloonText": "[[title]] of [[category]]:[[value]]",
							"fillAlphas": 1,
							"id": "AmGraph-1",
							"title": "Профили",
							"type": "column",
							"valueField": "value"
						}
					],
					"guides": [],
					"valueAxes": [
						{
							"id": "ValueAxis-1",
							"title": "Кол-во человек"
						}
					],
					"allLabels": [],
					"balloon": {},
					"legend": {
						"useGraphSettings": true
					},
					"titles": [
						{
							"id": "Title-1",
							"size": 15,
							"text": "Профили"
						}
					],
					"dataProvider": chartData[0]
				}
			);
});
$(document).on("dataAcquired1",function(){
    

	AmCharts.makeChart("chartdiv2",
				{
					"type": "pie",
					"pathToImages": "http://cdn.amcharts.com/lib/3/images/",
					"angle": 12,
                    "fontSize": 5,
					"balloonText": "[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>",
					"depth3D": 15,
					"innerRadius": "40%",
					"titleField": "category",
					"valueField": "value",
					"allLabels": [],
					"balloon": {},
					"legend": {
						"align": "center",
						"markerType": "circle"
					},
					"titles": [],
					"dataProvider": chartData[1]
				}
			);
});
$(document).on("dataAcquired2",function(){
    

    gauge = AmCharts.makeChart("chartdiv3",
				{
					"type": "gauge",
					"pathToImages": "http://cdn.amcharts.com/lib/3/images/",
					"theme": "default",
					"arrows": [
						{
							"id": "GaugeArrow-1",
						}
					],
					"axes": [
						{
							"bottomText": "0  человек",
							"bottomTextYOffset": -20,
							"endValue": 100000,
							"id": "GaugeAxis-1",
							"valueInterval": 10000,
							"bands": [
								{
									"color": "#00CC00",
									"endValue": 40000,
									"id": "GaugeBand-1",
									"startValue": 0
								},
								{
									"color": "#ffac29",
									"endValue": 80000,
									"id": "GaugeBand-2",
									"startValue": 40000
								},
								{
									"color": "#ea3838",
									"endValue": 100000,
									"id": "GaugeBand-3",
									"innerRadius": "95%",
									"startValue": 80000
								}
							]
						}
					],
					"allLabels": [],
					"balloon": {},
					"titles": [
						{
							"id": "Title-1",
							"size": 15,
							"text": "Speedometer"
						}
					]
				}
                       
			);
    var v = chartData[2][0].value;
    gauge.arrows[0].setValue(v);
    gauge.axes[0].setBottomText(v + " человек");
});

var opts = {
    id:0,
    url:"http://37.139.4.54/tfoms/MDX",
    type:"POST",
    data:{
        MDX:'SELECT NON EMPTY {TOPPERCENT(ORDER([ProfileMODep].[H1].[Profile].Members,Measures.[%COUNT],BDESC),80),%LABEL(SUM(BOTTOMPERCENT(ORDER([ProfileMODep].[H1].[Profile].Members,Measures.[%COUNT],BDESC),20)),"Другой",,,,"font-style:italic;")} ON 1 FROM [QueueCube] %FILTER [status].[H1].[status].&[0]'
    },
    username:"_SYSTEM",
    password:"<PASSWORD>",
    success: function( d ) {
        console.log(d);
        if(d) { 
            var d = JSON.parse(d) || d;
            var transformedData = [];
            for(var i=0;i<d.axes[1].tuples.length;i++) {
                transformedData.push({
                    category:d.axes[1].tuples[i].caption,
                    value:d.cells[i]
                });
            }
            console.log(this.id, transformedData);
            chartData[this.id]=transformedData;
        }
        $(document).trigger("dataAcquired"+this.id);
        return 1;
    }
}
$.ajax( opts );

var opts2 = $.extend(opts,{
    data : {MDX:'SELECT NON EMPTY HEAD(ORDER([MUFULLProrfle].[H1].[MU].Members,Measures.[%COUNT],BDESC),5) ON 1 FROM [QueueCube] %FILTER [status].[H1].[status].&[0]'},id:1
});
$.ajax(opts2);

var opts3 = $.extend(opts,{
    data : {MDX:'SELECT NON EMPTY {%LABEL([status].[H1].[status].&[0],"В очереди",""),%LABEL([Measures].[%COUNT],"Всего","")} ON 0 FROM [QueueCube]'},id:2
});
$.ajax(opts3);

{'fraction_non_alphanumeric': 0.21592522479886417, 'fraction_numerical': 0.029933743492664457, 'mean_word_length': 2.058248914616498, 'pattern_counts': {'":': 153, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3343072', 'n_tokens_mistral': 4391, 'n_tokens_neox': 2990, 'n_words': 438}