I'm making a chart in VisualStudio WinForms with some data columns and I want to place labels for some of them. Main problem is that labels for first and last columns are not shown. Min and Max for chart is fixed and datapoints can be at min and max.
For example I made a chart with series[0].ChartType = "Column" and assigned labels by setting series[0].Label property to show X,Y,index and some text string, also set series[0].LabelBackColor and series[0].LabelBorderColor to make a box.
That is what I got:
Text is outside the background box, labels are overlapping borders but AxisY(on the left) is still visible; and labels for x=0 and x=10 are not shown at all! Also with Column type all the opertaions written below had no effect.
Actually I need StackedColumn type, so: then I changed type to series[0].ChartType = "StackedColumn" and got this:
Boxes are bigger but still overlapping with AxisY line and numbers on top, and still no first and last labels.
I tried to set series[0].SmartLabelStyle.IsOverlappingHidden = false and got this:
AxisX and AxisY lines and markers are shown above labels. Thats no good.
Then I tried to disable SmartLabelStyle at all by setting: series[0].SmartLabelStyle.Enabled = false and got this:
Not much better. Even labels are overlapping now.
At last I tried to force Labels to move by enabling SmartLabelStyle and setting series[0].SmartLabelStyle.MovingDirection = "Right | Left" and got this:
Now Text in Labels is moved properly, but background box is not. If that box moved properly as well that would be enough, but it didn't.
I'm out of ideas how to make DataPoint Labels show properly on the left and right sides of the chart.
Is there a way to set Label position for it text and box? How to set Label box to be proper size for text?
I definitely want to avoid chart.Paint methods.