• OWC11 实现双Y轴


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

            //给定series的名字  
            InsertChart.SeriesCollection[5].SetData(ChartDimensionsEnum.chDimSeriesNames, (int)ChartSpecialDataSourcesEnum.chDataLiteral, GetLocalResourceObject("mets_chart_7_micturate_total_Times").ToString());//"night times"
            //给定分类  
            InsertChart.SeriesCollection[5].SetData(ChartDimensionsEnum.chDimCategories, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strXdata);
            //给定值  
            InsertChart.SeriesCollection[5].SetData(ChartDimensionsEnum.chDimValues, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strYdata1);
            //输出文件


            InsertChart.SeriesCollection.Add(6);
            InsertChart.SeriesCollection.Add(7);
            InsertChart.SeriesCollection.Add(8);
            InsertChart.SeriesCollection[8].Ungroup(true);
            InsertChart.SeriesCollection[7].Ungroup(true);
            InsertChart.SeriesCollection[6].Ungroup(true);

            InsertChart.SeriesCollection[6].DataLabelsCollection.Add();
            // 给定series的名字  
            InsertChart.SeriesCollection[6].SetData(ChartDimensionsEnum.chDimSeriesNames, (int)ChartSpecialDataSourcesEnum.chDataLiteral, GetLocalResourceObject("mets_chart_7_micturate_night_times").ToString());//"night times"
            // 给定分类  
            InsertChart.SeriesCollection[6].SetData(ChartDimensionsEnum.chDimCategories, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strXdata);
            //给定值  
            InsertChart.SeriesCollection[6].SetData(ChartDimensionsEnum.chDimValues, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strYdata3);


            InsertChart.SeriesCollection[7].DataLabelsCollection.Add();
            // 给定series的名字  
            InsertChart.SeriesCollection[7].SetData(ChartDimensionsEnum.chDimSeriesNames, (int)ChartSpecialDataSourcesEnum.chDataLiteral, "aaa");//"night times"
            // 给定分类  
            InsertChart.SeriesCollection[7].SetData(ChartDimensionsEnum.chDimCategories, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strXdata);
            //给定值  
            InsertChart.SeriesCollection[7].SetData(ChartDimensionsEnum.chDimValues, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strYdata3);

            InsertChart.SeriesCollection[8].DataLabelsCollection.Add();
            // 给定series的名字  
            InsertChart.SeriesCollection[8].SetData(ChartDimensionsEnum.chDimSeriesNames, (int)ChartSpecialDataSourcesEnum.chDataLiteral, "aaa");//"night times"
            // 给定分类  
            InsertChart.SeriesCollection[8].SetData(ChartDimensionsEnum.chDimCategories, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strXdata);
            //给定值  
            InsertChart.SeriesCollection[8].SetData(ChartDimensionsEnum.chDimValues, (int)ChartSpecialDataSourcesEnum.chDataLiteral, strYdata3);

            InsertChart.SeriesCollection[5].Line.DashStyle = ChartLineDashStyleEnum.chLineDash;
            InsertChart.SeriesCollection[6].Line.DashStyle = ChartLineDashStyleEnum.chLineDash;
            InsertChart.SeriesCollection[7].Line.DashStyle = ChartLineDashStyleEnum.chLineDash;
            InsertChart.SeriesCollection[8].Line.DashStyle = ChartLineDashStyleEnum.chLineDash;

            InsertChart.SeriesCollection[5].Ungroup(true);
            InsertChart.SeriesCollection[5].Group(InsertChart.SeriesCollection[6]);
            InsertChart.SeriesCollection[5].Group(InsertChart.SeriesCollection[7]);
            InsertChart.SeriesCollection[5].Group(InsertChart.SeriesCollection[8]);
     
            Microsoft.Office.Interop.Owc11.ChAxis seAxes = InsertChart.Axes.Add(InsertChart.SeriesCollection[5].get_Scalings(ChartDimensionsEnum.chDimValues));
            seAxes.Position = Microsoft.Office.Interop.Owc11.ChartAxisPositionEnum.chAxisPositionRight;
            seAxes.HasMajorGridlines = false;
           
            seAxes.Scaling.Minimum = 0;
            InsertChart.Axes[2].HasTitle = true;
            InsertChart.Axes[2].Title.Caption = GetLocalResourceObject("mets_chart_7_right_YAxes_Title").ToString();
           

  • 相关阅读:
    VS2005 中关于“LC.EXE已退出,代码为 1”的错误解决方法。
    由于目标机器积极拒绝,无法连接。
    What is Android?
    利用批处理文件和任务计划实现Oracle数据库的自动备份
    就差了一点点....
    由Login.aspx引发编译器错误的解决方法
    都是补丁惹的祸...
    终于结束了
    GIS当然可以很酷
    rar.exe命令行参数与示例
  • 原文地址:https://www.cnblogs.com/lingxzg/p/1712897.html
Copyright © 2020-2023  润新知