1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| boxPlotChart.SuspendLayout();
boxPlotChart.ChartAreas[CHARTAREA_NAME].AxisX.CustomLabels.Clear();
List<DataManager.Variable> variables = ProcessVariable.variablesList2(true);
double min = double.MaxValue;
double max = double.MinValue;
for (int i = 0; i < _boxPlotList.Count; i++)
{
int count = 1;
foreach (DataPoint dp in _boxPlotList[i].Points)
{
if (count == 1)
{
min = Math.Min(min, _boxPlotList[i].Points.FindMinByValue().YValues[0]);
max = Math.Max(max, _boxPlotList[i].Points.FindMaxByValue().YValues[1]);
}
dp.XValue = count;
if (i == 0)
{
if (_byGroup)
{
customLabelAxisX(count, /*(count - 1).ToString()*/(count - 1) == 0 ? "TRUE" : "FALSE");
boxPlotLegend(true);
}
else
{
customLabelAxisX(count, _selectedVariables[count - 1]);
boxPlotToolip(dp, variables.First(var => var.Id.Equals(_selectedVariables[count - 1])));
boxPlotLegend(false);
}
}
if (_byGroup)
{
boxPlotToolip(dp, variables.First(var => var.Id.Equals(_selectedVariables[i])));
}
count += 1;
}
if (count == _boxPlotList[i].Points.Count + 1 && i == 0)
{
boxPlotChart.ChartAreas[CHARTAREA_NAME].AxisX.Minimum = -1;
boxPlotChart.ChartAreas[CHARTAREA_NAME].AxisX.Maximum = _boxPlotList[i].Points.Count + 1;
if (boxPlotChart.ChartAreas[CHARTAREA_NAME].AxisX.Minimum == boxPlotChart.ChartAreas[CHARTAREA_NAME].AxisX.Maximum)
{
boxPlotChart.ChartAreas[CHARTAREA_NAME].AxisX.Maximum += 1;
boxPlotChart.ChartAreas[CHARTAREA_NAME].AxisX.Minimum -= 1;
}
}
if (i == _boxPlotList.Count - 1)
{
boxPlotChart.ChartAreas[CHARTAREA_NAME].AxisY.Minimum = min - ((max - min) / 4);
boxPlotChart.ChartAreas[CHARTAREA_NAME].AxisY.Maximum = max + ((max - min) / 4);
} |
Partager