如图,当出现负数的时候,x轴未知出现空白带,将图分为2个区域。 怎么可以将2个区域合起来,这个空白太难看了。至少,能缩小的很窄也行 啊。
部分代码如下:
ChartSpace laySpace = new ChartSpaceClass(); // 创建ChartSpace对象来放置图表
ChChart InsertChart = laySpace.Charts.Add(0); // 在ChartSpace对象中添加图表
InsertChart.Type = ChartChartTypeEnum.chChartTypeLine; // 指定绘制图表的类型:折线图, 类型通过OWC.ChartChartTypeEnum枚举值得到
InsertChart.HasLegend = true; // 图表不需要图例标注、不需要标题
InsertChart.HasTitle = false;
InsertChart.Axes[0].HasTitle = true;
InsertChart.Axes[0].Title.Caption = "日期";
InsertChart.Axes[1].HasTitle = true;
InsertChart.Axes[1].Scaling.SplitMaximum=0;
InsertChart.Axes[1].Title.Caption = "涨跌 %";
InsertChart.SeriesCollection.Add(0); // 添加一个series系列
InsertChart.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimSeriesNames, +(int)ChartSpecialDataSourcesEnum.chDataLiteral, strSeriesName); // 给定分类
InsertChart.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimCategories, +(int)ChartSpecialDataSourcesEnum.chDataLiteral, strXdata); // 给定值
InsertChart.SeriesCollection[0].SetData(ChartDimensionsEnum.chDimValues,+(int)ChartSpecialDataSourcesEnum.chDataLiteral, strYdata);
string strAbsolutePath = (Server.MapPath(".")) + "\\ShowData.gif";
laySpace.ExportPicture(strAbsolutePath, "GIF", 870, 450);
string strRelativePath = "./ShowData.gif"; // 创建GIF文件的相对路径.
Panel1.BackImageUrl = strRelativePath.ToString();