以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 双图表问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=121875) |
-- 作者:HJG_HB950207 -- 发布时间:2018/7/14 16:29:00 -- 双图表问题 以下代码,如何修改才能达到以下目的: 1.两个指标的示意图在双图表中重叠时,如何透明? 2.如何让双图表导到电子表格更清晰。 ............................... Dim Chart As WinForm.Chart \'定义一个图表变量 Dim Series As WinForm.ChartSeries \'定义一个图系变量 Chart = e.Form.Controls("Chart1") \' 引用窗口中的图表 Chart.VisualEffect = True \'加上这一行,让你的图表更漂亮 Chart.ChartType = ChartTypeEnum.Bar \'图表1类型该为Bar(条形) \'Chart.ChartType2 = ChartTypeEnum.BAR Chart.DataSource = "销售表" \'设置绑定表 Chart.SeriesList.Clear() \'清除图表原来的图系 Series = Chart.SeriesList.Add() \'给图表1增加一个图系 Series.Text = "数量" Series.X.DataField = "产品" \'X轴绑定到产品列 Series.Y.DataField = "数量" \'Y轴绑定到数量列 Series.DataLabelText = "{#YVAL}" Chart.SeriesList2.Clear() \'清除图表原来的图系 Series = Chart.SeriesList2.Add() \'给图表2增加一个图系 Series.Text = "金额" Series.X.DataField = "产品" \'X轴绑定到产品列 Series.Y.DataField = "金额" \'Y轴绑定到数量列 Chart.LegendVisible = True \'显示图列 Chart.LegendCompass= CompassEnum.South \'图列显示在南方(底端) Chart.AxisY.Text = "数量" Chart.AxisY2.Text = "金额" Series.MarkShape= MarkShapeEnum.Diamond Series.DataLabelText = "{#YVAL}" ....................................... Dim b As New XLS.Book Dim t As Table = Tables("销售表") Dim s As XLS.Sheet = b.Sheets(0) Dim Chart As WinForm.Chart = Forms("窗口2").Controls("Chart1") For c As Integer = 0 To t.Cols.Count -1 \'添加列标题 s(0, c).Value = t.Cols(c).Name Next For r As Integer = 0 To t.Rows.Count - 1 \'填入数据 For c As Integer = 0 To t.Cols.Count -1 s(r +1, c).Value = t.rows(r)(c) Next Next \'插入图表 s(t.rows.Count + 2,1).Value = New XLS.Picture(Chart.Image,0,0,422,258) b.Save("c:\\test.xls") Dim Proc As New Process Proc.File = "c:\\test.xls" Proc.Start() |
-- 作者:HJG_HB950207 -- 发布时间:2018/7/14 16:38:00 -- 上图 1.导到电子表格后不清晰2.蓝色挡住红色数据线 请教解决上问题,如何修改? 谢谢老师! |
-- 作者:有点蓝 -- 发布时间:2018/7/14 17:21:00 -- 1、没有办法设置透明 2、图片质量,试试保存为图片在引用
|