Example #1
0
        public void slide20(ISlide slide)
        {
            // var a = from a in [email protected]()
            //        group a by
            //Charts.SingleAxexchart(slide, Cache_data_cjjl.by., 2);

            var query = from t in [email protected]()
                        group t by new { t1 = t.Field <string>("lpmc") } into m
                select new
            {
                lpmc = m.Key.t1,
                cjje = m.Sum(n => n.Field <long>("cjje"))
            };
            DataTable dt = new DataTable();

            dt.Columns.Add("lpmc");
            dt.Columns.Add("cjje");
            foreach (var item in query.OrderByDescending(m => m.cjje).Take(10).ToList())
            {
                DataRow dr = dt.NewRow();
                dr[0] = item.lpmc;
                dr[1] = item.cjje.je_yy();
                dt.Rows.Add(dr);
            }
            Office_ChartStyle style = new Office_ChartStyle();

            style.坐标方向   = Base_Config.坐标方向.纵向;
            style.文字位置   = Aspose.Slides.Charts.LegendDataLabelPosition.OutsideEnd;
            style.文字旋转方向 = TextVerticalType.Horizontal;
            style.是否显示文字 = true;
            Office_Charts.SingleAxexchart(slide, dt, 1, style);
        }
Example #2
0
        public void slide18(ISlide slide)
        {
            Office_ChartStyle style = new Office_ChartStyle();

            style.坐标方向   = Base_Config.坐标方向.横向;
            style.文字位置   = Aspose.Slides.Charts.LegendDataLabelPosition.Center;
            style.文字旋转方向 = TextVerticalType.Vertical270;
            style.是否显示文字 = true;
            Office_Charts.SingleAxexchart(slide, Cache_Result_yb.jsjg_scjgfx, 2, style);

            IAutoShape itf = (IAutoShape)slide.Shapes[5];

            itf.TextFrame.Paragraphs[0].Text = thread5();
            itf.TextFrame.Paragraphs[1].Text = thread6();
            ITextFrame tf = itf.TextFrame;

            foreach (var item in tf.Paragraphs)
            {
                IPortion port = item.Portions[0];
                port.PortionFormat.LatinFont  = new FontData("微软雅黑");
                port.PortionFormat.FontBold   = NullableBool.NotDefined;
                port.PortionFormat.FontHeight = 12;
            }
        }