700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 使用OWC 做图表时按周 月 年设置时间刻度是参数无效问题解决方法

使用OWC 做图表时按周 月 年设置时间刻度是参数无效问题解决方法

时间:2023-02-06 17:24:50

相关推荐

使用OWC 做图表时按周 月 年设置时间刻度是参数无效问题解决方法

设置如下时间刻度:

ChartAxisGroupingEnum.chAxisGroupingManual;

ChartAxisUnitTypeEnum.chAxisUnitMonth;

需要在SetData后面加上上面属性,否则会出现参数无效问题:

InsertChart.SeriesCollection.Add(0);

InsertChart.SeriesCollection[0].DataLabelsCollection.Add();

InsertChart.SeriesCollection[0].DataLabelsCollection[0].HasValue = true;

InsertChart.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimSeriesNames, +(int)ChartSpecialDataSourcesEnum.chDataLiteral, "销售总额");

InsertChart.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimCategories, +(int)ChartSpecialDataSourcesEnum.chDataLiteral, strXdata);

InsertChart.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimValues, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strYdata);

InsertChart.Axes[0].GroupingType = OWC10.ChartAxisGroupingEnum.chAxisGroupingManual;

InsertChart.Axes[0].GroupingUnitType = ChartAxisUnitTypeEnum.chAxisUnitMonth;

InsertChart.Axes[0].NumberFormat = "yyyy-MM";

InsertChart.Axes[0].GroupingUnit = 1;

本文转自94cool博客园博客,原文链接:/94cool/archive//05/11/2043231.html,如需转载请自行联系原作者

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。