抖音资讯

douyinzx

word插件开发支持哪些语言(word开发工具属性)

iseeyu2年前 (2024-05-08)抖音资讯136

1, 在excel里面多个柱状图会重叠在图表里面,这是因为多个柱状图不重叠的话type要设置成Orig.ChartType =
XlChartType.xlColumnClustered;; 重叠的话,Orig.ChartType = XlChartType.xlColumnStacked;

2 关于图例:如果设置position 的话,图例会横向排列,不设置

// chart.Legend.Position =
Excel.XlLegendPosition.xlLegendPositionTop; 图例会竖着排列

chart.Legend.Left = 80;

chart.Legend.Height = 15* list.Count();

chart.Legend.IncludeInLayout = true;

chart.Legend.Top = 0;

chart.Legend.Width = 150;

// chart.Legend.Position = Excel.XlLegendPosition.xlLegendPositionTop;

chart.Legend.Font.Color = ColorTranslator.ToOle(Color.Black);

3 xAxis.MinorTickMark =
Excel.XlTickMark.xlTickMarkOutside;坐标轴刻度


xAxis.TickLabels.NumberFormat = "yyyy-mm-dd"; 坐标轴时间设置

4 调用
Microsoft.Office.Interop.Excel.Shape myChart = newWorksheet.Shapes.AddChart2(-1, XlChartType.xlLine, 250, 50, width, 165, true); 会在图表默认生成一条空数据的图形,要删除

Excel.SeriesCollection seriescollectionB2 = chart.SeriesCollection();

int cc = seriescollectionB2.Count;

seriescollectionB2.Item(1).Delete();

 

#function

public static Microsoft.Office.Interop.Excel.Shape GetChart(Excel.Application eApp,Document document, WordCharItem onechartData, ContentControl c, int width)

{

Excel.Worksheet newWorksheet = eApp.Worksheets.Add();//获取第一个Worksheet

//newWorksheet.Activate();

//向表格中插入数据

string[,] array = ExtractHelper.GetKeppArray(onechartData.chartIndexDataList);

var list = onechartData.chartIndexList.OrderBy(p => p.axisType);

int indexcount = list.Count();

int rowIndex = 0;

int columnIndex = 1;

int columnlength1 = onechartData.chartIndexDataList[0].Split(ExtractHelper.splitchar).Length;

int headerCount = 1;

int lenght = onechartData.chartIndexDataList.Length - headerCount;

int rowlenght = onechartData.chartIndexDataList.Length - 1;

Microsoft.Office.Interop.Excel.Range c1 = newWorksheet.Cells[rowIndex + 1, columnIndex];

Microsoft.Office.Interop.Excel.Range c3 = newWorksheet.Cells[rowIndex + rowlenght, columnlength1];

Microsoft.Office.Interop.Excel.Range range3 = newWorksheet.Range[c1, c3];

range3.Value2 = array;

//range3.NumberFormat= numberFormat;

int SeriesCount = onechartData.chartIndexList.Count();

Microsoft.Office.Interop.Excel.Range timeStartRange = newWorksheet.Cells[1, 1];

Microsoft.Office.Interop.Excel.Range timeEndRange = newWorksheet.Cells[rowlenght, 1]; ;

Microsoft.Office.Interop.Excel.Range XValues = newWorksheet.Range[timeStartRange, timeEndRange];

XValues.NumberFormat = "yyyy/m/d";

Microsoft.Office.Interop.Excel.Range dataStartRange = newWorksheet.Cells[1, 2];

Microsoft.Office.Interop.Excel.Range dataEndRange = newWorksheet.Cells[rowlenght, columnlength1];

Microsoft.Office.Interop.Excel.Range dataRANGE = newWorksheet.Range[dataStartRange, dataEndRange];

dataRANGE.NumberFormat = numberFormat;

Microsoft.Office.Interop.Excel.Shape myChart = newWorksheet.Shapes.AddChart2(-1, XlChartType.xlLine, 250, 50, width, 165, true);

Excel.Chart chart = myChart.Chart;

// 设置图表标题

chart.HasTitle = true;

chart.ChartTitle.Text = onechartData.title;

chart.ChartTitle.Font.Name = zhongwenstr;

chart.ChartTitle.Font.Size = 8f;

chart.ChartTitle.Font.Bold = 1;

chart.ChartTitle.Font.Color = ColorTranslator.ToOle(Color.Black);

chart.ChartTitle.HorizontalAlignment = XlConstants.xlLeft;

chart.ChartTitle.Left = 0;

//chart.ChartArea.Left = 0;

chart.PlotArea.InsideLeft = 3;

chart.PlotArea.InsideWidth = 230;

Excel.SeriesCollection seriescollectionB2 = chart.SeriesCollection();

seriescollectionB2.Item(1).Delete();

string[] xarray = RangeHelper.GetOneColumnRange(XValues);

for (int i = 1; i <= indexcount; i++)

{

Excel.Series Orig = seriescollectionB2.NewSeries();

double[] yarrayy = new double[rowlenght];

for (int ii = 1; ii <= rowlenght; ii++)

{

Microsoft.Office.Interop.Excel.Range range = newWorksheet.Cells[ii, i + 1];

if (string.IsNullOrEmpty(range.Value2))

{

// yarrayy[ii - 1] = 0;

}

else

{

yarrayy[ii - 1] = Convert.ToDouble(range.Value2);

}

}

Orig.Name = list.ElementAt(i - 1).indexName;

Orig.XValues = xarray;

word插件开发支持哪些语言(word开发工具属性)

Orig.Values = yarrayy;

Orig.HasDataLabels = false;

if (i == 1)

{

Orig.AxisGroup = Microsoft.Office.Interop.Excel.XlAxisGroup.xlPrimary;

if (list.ElementAt(i-1).type == 1)

{

Orig.ChartType = XlChartType.xlLineStacked;

Orig.Format.Line.Weight = 1.2f;

Orig.Format.Line.ForeColor.RGB = StyleHelper.GetColorIntRGB(linecolor);

}

if (list.ElementAt(i-1).type == 2)

{

Orig.ChartType = XlChartType.xlColumnStacked;

Orig.Interior.Color = ColorTranslator.ToOle(Color.Gray);

}

Excel.Axis yAxis = (Excel.Axis)chart.Axes(Excel.XlAxisType.xlValue, Excel.XlAxisGroup.xlPrimary);

yAxis.HasDisplayUnitLabel = true;

yAxis.DisplayUnitCustom = 1;

yAxis.DisplayUnitLabel.Orientation = XlOrientation.xlHorizontal;

yAxis.DisplayUnitLabel.Left = 15;

yAxis.DisplayUnitLabel.Top = 10;

yAxis.DisplayUnitLabel.Font.Name = zhongwenstr;

yAxis.DisplayUnitLabel.Font.Size = 8f;

//yAxis.DisplayUnit=XlDisplayUnit.

yAxis.TickLabels.Font.Name = fontname;

yAxis.TickLabels.Font.Size = fontsize;

yAxis.TickLabels.Font.Color = XlRgbColor.rgbBlack;

yAxis.MajorTickMark = Excel.XlTickMark.xlTickMarkOutside;

yAxis.HasMinorGridlines = false;

yAxis.HasMajorGridlines = false;

yAxis.Format.Line.ForeColor.RGB = (int)XlRgbColor.rgbBlack;

yAxis.Format.Line.Weight = 1;

yAxis.Border.Color = ColorTranslator.ToOle(Color.Black);//y轴颜色

yAxis.DisplayUnitLabel.Text = list.ElementAt(i-1).unit;

 

}

if (i == 2)

{

if (list.ElementAt(i-1).type == 1)

{

Orig.ChartType = XlChartType.xlLineStacked;

Orig.Format.Line.Weight = 1.2f;

Orig.Format.Line.ForeColor.RGB = StyleHelper.GetColorIntRGB("0,174,239");

}

if (list.ElementAt(i-1).type == 2)

{

Orig.ChartType = XlChartType.xlColumnStacked;

Orig.Interior.Color = ColorTranslator.ToOle(Color.Gray);

}

 

Orig.AxisGroup = Microsoft.Office.Interop.Excel.XlAxisGroup.xlSecondary;

Excel.Axis ysecondAxis = (Excel.Axis)chart.Axes(Excel.XlAxisType.xlValue, Excel.XlAxisGroup.xlSecondary);

ysecondAxis.HasDisplayUnitLabel = true;

//ysecondAxis.DisplayUnit = XlDisplayUnit.xlHundreds;

ysecondAxis.DisplayUnitCustom = 1;

ysecondAxis.DisplayUnitLabel.Left = 210;

ysecondAxis.DisplayUnitLabel.Top = 10;

//ysecondAxis.DisplayUnitLabel.VerticalAlignment=

ysecondAxis.DisplayUnitLabel.Orientation = XlOrientation.xlHorizontal;

ysecondAxis.DisplayUnitLabel.Position = Excel.XlChartElementPosition.xlChartElementPositionCustom;

ysecondAxis.DisplayUnitLabel.Font.Name = zhongwenstr;

ysecondAxis.DisplayUnitLabel.Font.Size = 8f;

ysecondAxis.TickLabels.Font.Name = fontname;

ysecondAxis.TickLabels.Font.Size = fontsize;

ysecondAxis.TickLabels.Font.Color = ColorTranslator.ToOle(Color.Black);

ysecondAxis.DisplayUnitLabel.Text = list.ElementAt(i-1).unit;

ysecondAxis.Border.Color = ColorTranslator.ToOle(Color.Black);//y轴颜色

}

if (i == 3)

{

Orig.AxisGroup = Microsoft.Office.Interop.Excel.XlAxisGroup.xlSecondary;

if (list.ElementAt(i-1).type == 1)

{

Orig.ChartType = XlChartType.xlLine;

Orig.Format.Line.ForeColor.RGB = StyleHelper.GetColorIntRGB(linecolor);

Orig.Format.Line.Weight = 1.2f;

}

if (list.ElementAt(i-1).type == 2)

{

Orig.ChartType = XlChartType.xlColumnClustered;

Orig.Interior.Color = ColorTranslator.ToOle(Color.Gray);

}

Orig.HasDataLabels = false;

//StyleHelper.SetSeries(Orig, "55,155,30");

Orig.Format.Line.ForeColor.RGB = StyleHelper.GetColorIntRGB(linecolor);

Orig.Format.Line.Weight = 1;

Excel.Axis ysecondAxis = (Excel.Axis)chart.Axes(Excel.XlAxisType.xlValue, Excel.XlAxisGroup.xlSecondary);

ysecondAxis.HasDisplayUnitLabel = true;

ysecondAxis.DisplayUnitCustom = 1;

ysecondAxis.DisplayUnitLabel.Orientation = XlOrientation.xlHorizontal;

ysecondAxis.DisplayUnitLabel.Font.Name = zhongwenstr;

ysecondAxis.DisplayUnitLabel.Font.Size = 8f;

ysecondAxis.TickLabels.Font.Name = fontname;

ysecondAxis.TickLabels.Font.Size = fontsize;

ysecondAxis.TickLabels.Font.Color = XlRgbColor.rgbBlack;

ysecondAxis.DisplayUnitLabel.Text = list.ElementAt(i-1).unit;

ysecondAxis.Border.Color = ColorTranslator.ToOle(Color.Black);//y轴颜色

}

if (i == 4)

{

Orig.AxisGroup = Microsoft.Office.Interop.Excel.XlAxisGroup.xlSecondary;

if (list.ElementAt(i-1).type == 1)

{

Orig.ChartType = XlChartType.xlXYScatterLinesNoMarkers;

Orig.Format.Line.ForeColor.RGB = StyleHelper.GetColorIntRGB("0,174,239");

Orig.Format.Line.Weight = 1.2f;

}

if (list.ElementAt(i-1).type == 2)

{

Orig.Interior.Color = StyleHelper.GetColorIntRGB("0,55,120");

Orig.ChartType = XlChartType.xlColumnClustered;

}

//StyleHelper.SetSeries(Orig, "5,15,130");

Orig.Format.Line.ForeColor.RGB = StyleHelper.GetColorIntRGB(linecolor);

Orig.Format.Line.Weight = 1;

Excel.Axis ysecondAxis = (Excel.Axis)chart.Axes(Excel.XlAxisType.xlValue, Excel.XlAxisGroup.xlSecondary);

ysecondAxis.HasDisplayUnitLabel = true;

ysecondAxis.DisplayUnitLabel.Orientation = XlOrientation.xlHorizontal;

ysecondAxis.DisplayUnitCustom = 1;

ysecondAxis.DisplayUnitLabel.Font.Name = zhongwenstr;

ysecondAxis.DisplayUnitLabel.Font.Size = 8f;

ysecondAxis.TickLabels.Font.Name = fontname;

ysecondAxis.TickLabels.Font.Size = fontsize;

ysecondAxis.TickLabels.Font.Color = XlRgbColor.rgbBlack;

ysecondAxis.DisplayUnitLabel.Text = list.ElementAt(i-1).unit;

ysecondAxis.Border.Color = ColorTranslator.ToOle(Color.Black);//y轴颜色

}

}

// 设置y轴

//设置Y轴的显示

 

//yAxis.HasTitle = true;

Excel.Axis xAxis = (Excel.Axis)chart.Axes(Excel.XlAxisType.xlCategory, Excel.XlAxisGroup.xlPrimary);

 

xAxis.CategoryNames = xarray;

//xAxis.CategoryType = Excel.XlCategoryType.xlTimeScale;

xAxis.TickLabelPosition = Excel.XlTickLabelPosition.xlTickLabelPositionLow;

xAxis.TickLabels.Orientation = Excel.XlTickLabelOrientation.xlTickLabelOrientationDownward;

xAxis.TickLabels.Font.Name = fontname;

xAxis.TickLabels.NumberFormat = "yyyy-mm-dd";

xAxis.TickLabels.Font.Size = 8f;

xAxis.TickLabels.Font.Color = XlRgbColor.rgbBlack;

xAxis.MinorTickMark = Excel.XlTickMark.xlTickMarkOutside;

// xAxis.HasTitle = true;

//xAxis.AxisTitle.Orientation = Excel.XlOrientation.xlHorizontal;

 

//yAxis.HasDisplayUnitLabel = true;

xAxis.Format.Line.ForeColor.RGB = (int)XlRgbColor.rgbBlack;

xAxis.Format.Line.Weight = 1;

xAxis.Border.Color = ColorTranslator.ToOle(Color.Black);//y轴颜色

xAxis.TickLabels.MultiLevel = true;

chart.HasLegend = true;

chart.ChartTitle.Font.Name = zhongwenstr;

chart.Legend.Left = 80;

chart.Legend.Height = 15 * indexcount;

chart.Legend.IncludeInLayout = true;

chart.Legend.Top = 0;

chart.Legend.Width = 150;

// chart.Legend.Position = Excel.XlLegendPosition.xlLegendPositionTop;

chart.Legend.Font.Color = ColorTranslator.ToOle(Color.Black);

chart.Legend.Font.Name = zhongwenstr;

chart.Legend.Font.Size = 8f;

return myChart;

扫描二维码推送至手机访问。

版权声明:本文由西安泽虎代运营发布,如需转载请注明出处。

转载请注明出处https://www.0291.com.cn/post/42444.html

相关文章

直播代运营合同避坑:报价、KPI、违约金一次说清

直播代运营合同避坑:报价、KPI、违约金一次说清

去年西安一家女装店老板拿着合同来找我看,就一页纸,上面写着“保证月销30万”。签的时候高高兴兴,三个月后只卖了8万,代运营公司一句“市场环境不好”就撒手不管了。老板想退钱,翻出合同才发现,什么叫销售额、含不含退款、考核多久、数据以谁为准,一个字都没写。这种坑我这两年见了不止十回。 直播代运营合同看...

抖音千川投放怎么投?2026新手起量避坑指南

抖音千川投放怎么投?2026新手起量避坑指南

西安一家做本地餐饮的老张,去年底听人说抖音能拉客,先充了3000块投DOU+。一个月下来,视频播放量是上去了,团购券没卖出几张。后来他才搞清楚,DOU+是给内容加热用的,真正能把团购券卖出去的工具叫巨量千川。2026年,在抖音上做生意的商家基本绕不开这两个东西:DOU+管内容热度,千川管成交转化。...

抖音短视频带货怎么做?2026年挂车出单实操指南

抖音短视频带货怎么做?2026年挂车出单实操指南

直播带货要开播、要人设、要话术,很多西安商家试了两次就放弃了。其实还有一条更轻的路:短视频带货。拍一条视频挂上商品链接,用户刷到直接下单,不用开播,不用连麦,一个人一部手机就能跑。我见过高新一家卖手工辣条的档口,老板就拍后厨炒料,一条视频爆了,挂车链接三天卖了四千多单。我自己也帮几个西安客户跑过这...

抖音矩阵号怎么做?2026年企业多账号布局实操

抖音矩阵号怎么做?2026年企业多账号布局实操

有个西安做门窗的老板跟我抱怨,说一个号发了大半年,播放量卡在一两千上不去,问我是不是号被限流了。我让他去搜搜本地同行,人家三个号轮着发,客户搜「西安封阳台」,翻两屏全是那一家。这不是玄学,就是矩阵。说白了,矩阵不是一个号发十遍,也不是开十个号复制粘贴,而是按客户会搜什么、信什么,把账号分工排好。尤...

抖音蹭热点总翻车?2026年商家追热点的正确姿势

抖音蹭热点总翻车?2026年商家追热点的正确姿势

上周有个做建材的老板问我:热搜上那个话题全网都在拍,我是不是也该跟一条?我反问他,拍完这条视频,客户凭什么找你买瓷砖?他愣了半天没答上来。这就是大多数商家蹭热点的真实状态——看见热点就冲,拍完发现除了播放量,什么都没留下。热点不是不能蹭,是大多数人都蹭错了。我盘过自己服务的客户数据:蹭热点视频的平...

企业抖音蓝V认证2026流程:材料准备与审核避坑

企业抖音蓝V认证2026流程:材料准备与审核避坑

企业号蓝V认证,现在几乎成了西安本地商家做抖音的起手式。不管是餐饮、装修、教育还是批发档口,想挂电话、想开团购、想投DOU+,基本都绕不开这一步。这篇文章把2026年最新的蓝V认证流程、要准备的材料、审核容易挂的地方一次讲清楚。蓝V认证到底有什么用?值不值600块蓝V说白了就是抖音给企业主体做的实...

现在,非常期待与您的又一次邂逅

我们努力让每一部企业宣传片和抖音短视频成为商业大片