Answer the question
In order to leave comments, you need to log in
C# How to place chart columns and labels strictly one above the other?
Friends help me understand how to place the chart columns strictly above their captions?
The screenshot shows the current version. I need to make all columns look like "Application #2". Below is the stripped-down code used to display such a chart.
ChartArea chArea = new ChartArea("Заявки");
chArea.AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
chArea.AxisX.Title = "Тип заявки";
chArea.AxisY.IntervalAutoMode = IntervalAutoMode.VariableCount;
chArea.AxisY.Title = "Количество заявок";
chart1.ChartAreas.Add(chArea);
Series seriesOper = new Series();
seriesOper.AxisLabel = "Заявка № 1";
var dp1 = seriesOper.Points.Add(1035); // значение по Y
chart1.Series.Add(seriesOper);
Series seriesPlan = new Series();
seriesPlan.AxisLabel = "Заявка № 2";
var dp2 = seriesPlan.Points.Add(861); // значение по Y
chart1.Series.Add(seriesPlan);
chart1.AlignDataPointsByAxisLabel(); // выравнивание столбцов по подписям осей. Без этого все столбцы стоят вплотную и подписи отсутствуют.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question