Asp.net diagram: final series getting cut off when installing .AxisX.Maximum

I am trying to bind a data table like

month       value
  5          345
  10         1300
  12         450

for an ASP.NET chart control. My problem is that the data table contains only months that have values, and on the chart I want to show the full range of months from 1st to 12th.

So i used

Chart1.ChartAreas["ChartArea1"].AxisX.Minimum = 1;
Chart1.ChartAreas["ChartArea1"].AxisX.Maximum = 12;

But when I do this, part of the final series is cut off in the middle, like this.

alt text

I can avoid this problem by making a maximum of 13, but that doesn't work, since I just need to show the months of the year. Please, help.

+3
source share

Source: https://habr.com/ru/post/1781108/


All Articles