Formatting Microsoft Chart Control X Axis labels for sub-categories to be like charts generated in Excel

后端 未结 1 1442
甜味超标
甜味超标 2021-01-18 05:54

I am having issues attempting to replicate a chart that has been generated in Microsoft Excel 2007 by using the Microsoft Chart Control for .Net

The chart is showing

1条回答
  •  一生所求
    2021-01-18 06:41

    I have managed to use a series of CustomLabel's that I manually position to be under the correct "sections".

    foreach (string monthName in monthNames)
    {
        CustomLabel monthLabel = new CustomLabel(startOffset, endOffset, monthName, 1,     LabelMarkStyle.Box);
        theChart.ChartAreas["Default"].AxisX.CustomLabels.Add(monthLabel);
        //increment startOffset and endOffset enough to position the next label
        //under the correct "section"
    }
    

    0 讨论(0)
提交回复
热议问题