Data Scale Height

I am using Microsoft Chart Control.

I am trying to adjust the height of a chart area programmatically. Depending on the lines. Because the Microsoft Chart control requires a height that cannot be a percentage, not Auto. Depending on the query you select, the chart may have 1 bar or it may have 100. That's why I need to adjust the height because large data sets seem twisted and unreadable.

I tried to add a counter heightCounter, which is the number of bars in the chart.

        int newHeight = (heightCounter * 10);

        // Maximum height aloud on Chart Control
        if (newHeight > 32767)
            newHeight = 32767;

        Chart1.Height = newHeight;

This sometimes works OK with smaller datasets. enter image description here

but when I have very large datasets, the name looks very spaced because the height is too high.

enter image description here

Is there a proper way to achieve this?

+4
1

, , , , ' , .

, . , , 10, .

, , , .

, , 10 ? ? , ( ).

0

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


All Articles