曲线图和折线图这种组合方式没碰到什么问题
但在k线图里准备加入曲线图一起显示时,却发现曲线图不会被显示
是否owc11里,k线图无法和别的图组合的?
部分代码 ChartSpace mySpace = new OWC11.ChartSpaceClass();
//在ChartSpace对象中添加图表,Add方法返回chart对象
ChChart myChart = mySpace.Charts.Add(0);
myChart.HasLegend = true;
myChart.HasTitle = true;
myChart.Title.Caption = "交易曲线图";
myChart.Axes[0].HasTitle = true;
myChart.Axes[0].Title.Caption = "数量";
myChart.Axes[1].HasTitle = true;
myChart.Axes[1].Title.Caption = "日期"; ChSeries myseries1 = myChart.SeriesCollection.Add(0);
myseries1.Type = ChartChartTypeEnum.chChartTypeLine;
myseries1.SetData(OWC11.ChartDimensionsEnum.chDimSeriesNames, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "折线");
myseries1.SetData(OWC11.ChartDimensionsEnum.chDimCategories, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strCateory);
myseries1.SetData(OWC11.ChartDimensionsEnum.chDimValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue); ChSeries myseries2 = myChart.SeriesCollection.Add(1);
myseries2.Type = ChartChartTypeEnum.chChartTypeSmoothLine;
myseries2.SetData(OWC11.ChartDimensionsEnum.chDimSeriesNames, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "曲线");
myseries2.SetData(OWC11.ChartDimensionsEnum.chDimCategories, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strCateory);
myseries2.SetData(OWC11.ChartDimensionsEnum.chDimValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue1); ChSeries myseries3 = myChart.SeriesCollection.Add(2);
myseries3.Type = ChartChartTypeEnum.chChartTypeStockOHLC;
myseries3.SetData(OWC11.ChartDimensionsEnum.chDimSeriesNames, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "k线");
myseries3.SetData(OWC11.ChartDimensionsEnum.chDimOpenValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue2);
myseries3.SetData(OWC11.ChartDimensionsEnum.chDimCloseValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue1);
myseries3.SetData(OWC11.ChartDimensionsEnum.chDimHighValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue1);
myseries3.SetData(OWC11.ChartDimensionsEnum.chDimLowValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue);
但在k线图里准备加入曲线图一起显示时,却发现曲线图不会被显示
是否owc11里,k线图无法和别的图组合的?
部分代码 ChartSpace mySpace = new OWC11.ChartSpaceClass();
//在ChartSpace对象中添加图表,Add方法返回chart对象
ChChart myChart = mySpace.Charts.Add(0);
myChart.HasLegend = true;
myChart.HasTitle = true;
myChart.Title.Caption = "交易曲线图";
myChart.Axes[0].HasTitle = true;
myChart.Axes[0].Title.Caption = "数量";
myChart.Axes[1].HasTitle = true;
myChart.Axes[1].Title.Caption = "日期"; ChSeries myseries1 = myChart.SeriesCollection.Add(0);
myseries1.Type = ChartChartTypeEnum.chChartTypeLine;
myseries1.SetData(OWC11.ChartDimensionsEnum.chDimSeriesNames, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "折线");
myseries1.SetData(OWC11.ChartDimensionsEnum.chDimCategories, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strCateory);
myseries1.SetData(OWC11.ChartDimensionsEnum.chDimValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue); ChSeries myseries2 = myChart.SeriesCollection.Add(1);
myseries2.Type = ChartChartTypeEnum.chChartTypeSmoothLine;
myseries2.SetData(OWC11.ChartDimensionsEnum.chDimSeriesNames, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "曲线");
myseries2.SetData(OWC11.ChartDimensionsEnum.chDimCategories, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strCateory);
myseries2.SetData(OWC11.ChartDimensionsEnum.chDimValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue1); ChSeries myseries3 = myChart.SeriesCollection.Add(2);
myseries3.Type = ChartChartTypeEnum.chChartTypeStockOHLC;
myseries3.SetData(OWC11.ChartDimensionsEnum.chDimSeriesNames, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, "k线");
myseries3.SetData(OWC11.ChartDimensionsEnum.chDimOpenValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue2);
myseries3.SetData(OWC11.ChartDimensionsEnum.chDimCloseValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue1);
myseries3.SetData(OWC11.ChartDimensionsEnum.chDimHighValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue1);
myseries3.SetData(OWC11.ChartDimensionsEnum.chDimLowValues, (int)OWC11.ChartSpecialDataSourcesEnum.chDataLiteral, strValue);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货