在Excel 2010中修改Series对象上的Z-index(Modify Z-index on Series object in Excel 2010)
我正在使用excel 2010。
我有一个图表图表,我在其上放置一个矩形围绕最高栏栏。
为了使事情更具可读性,我想将这个矩形放在图表上,但不要放在行/条/等前面......它必须在它们后面。
形状对象(如我的矩形)具有ZIndex属性,可以修改以实现该属性。 事实上,似乎不可能把它放在我的图表的元素之后,也不可能放在图表本身之后。
主要原因是Chart对象和Series对象(我的图表中的列)没有Z-Index属性。
有没有办法可以让我实现这个目标? 除了修改ZIndex属性?
I am using excel 2010.
I have a chart diagram on which i put a rectangle to surround the highest column bar.
In order to make things more readable, i would like to place this rectangle on the chart but NOT in front of the lines/bars/etc...It has to be behind them.
Shape objects (like my rectangle) have a ZIndex property than can be modified in order to achieve that. Thing is, it seems impossible to put that behind the elements of my chart, nor the chart itself.
The main reason is because Chart objects and Series objects (which are the columns inside my chart) doesn't have a Z-Index property.
Is there a way which could allow me to achieve this ? Other than modifying ZIndex property ?
原文:https://stackoverflow.com/questions/24575204
更新时间:2020-09-04 06:09
最满意答案
您可以在图表前面移动图表,或在图表前面移动图表。 但是你要做的是将Shape填入图表的某些组件后面,但仍然在图表背景前面。
据我所知,这是无法做到的。
但您可以通过简单地右键单击并调整属性,使图表的背景和绘图区域透明(无填充,而不是默认的白色填充)来模拟效果。
此外,您可以突出显示图表和形状( Ctrl-Multiple Select )并将两者锁定在一起,这样您的Shape看起来就像是图表的一部分,位于组件后面。
当然,形状将在整个图表本身的后面(通过设置适当的Z值,您可以通过简单地单击“ Record Macro并运行格式化一次来获取示例代码),但由于图表的背景是透明的,因此是情节区域,它看起来好像矩形在线条后面和所有。
You can move the Chart in front of the Shape, or the Shape in front of the Chart. But what you are looking to do is to stuff the Shape behind some components of the chart, but still in front of the chart background.
That, as far as I know cannot be done.
But you can simulate the effect by making the Chart's background and the Plot area transparent (no fill, instead of the default White fill) by simply right clicking and adjusting properties.
Also, you can highlight both the chart and the shape (Ctrl-Multiple Select) and lock the two together so your Shape will look like it's a part of the chart and is behind the components.
Of course, the shape will be behind the whole chart itself (by setting the appropriate Z-value, which you may find by simply clicking on Record Macro and running the formatting once to get sample code) but since the chart's background is transparent and so is the plot area's it'll look as if the rectangle's behind the lines and all.
相关问答
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
...
$("
zIndex: 123
}).appendTo("body");
要么 $("
"z-index": 123
}).appendTo("body");
.css() doc : ...此外,jQuery可以同样解释多字属性的CSS和DOM格式。 例如,jQuery理解并返回.css({'background-color': ...})和.css({backgroundColor: ...})的正确值。 $("
...
浏览器使用与常规元素稍有不同的元素进行渲染。 在这种情况下,它看起来像负z-索引被忽略,因为它的父变换。 如果重写一下html / css以使所有z-index值为正,那么它就可以工作。 在这种情况下,我已将#pointer的红色轮廓和白色背景移到了#pointer::before -element #pointer::before的#pointer::before ,并将#koule2的z-index更改为0。 如果您愿意,也可以用实际元素替换::before 。 #pointer {
...
对于像Popups和Markers这样的Billboards,您可以将放置优先级设置为大于0(这是默认值)。 通过StyleBuilder在Style级别中给出: BalloonPopupStyleBuilder builder = new BalloonPopupStyleBuilder();
builder.PlacementPriority = 1;
For Billboards like Popups and Markers you can set placement priority
...
使用旧的youtube嵌入方法并更改一些参数(将wmode设置为opaque ):
...
不幸的是,z-index不会影响Flash Player。 请参阅此示例: http : //demos.learnswfobject.com/html-over-swf/dynamic.html (相关教程 ) 在上面链接的示例中,父元素的position:"relative" ,HTML元素的position:"absolute" 。 SWF不需要指定position 。 没有指定z-index的元素。 SWF需要将wmode设置为opaque或transparent 。 wmode:"opa
...
就像我在评论中提到的那样( 我可能错了 ) DataLabel没有可用的形状属性,可以让你更改.ShapeStyle 。 但是我设法使用复杂的例程来实现你想要的。 逻辑 在工作表中插入一个临时形状,例如一个矩形 将.ShapeStyle应用于此形状 单独设置DataLabel的属性,如填充 , 边框颜色 , 边框样式 , 阴影等,以及形状中的属性。 完成后,删除形状。 码 Sub Sample()
Dim myChart As ChartObject
Dim chrt As Chart
Dim s
...
假设dataGridView1有2列, private void button5_Click(object sender, EventArgs e)
{
Excel.Application app = new Microsoft.Office.Interop.Excel.Application();
Excel.Workbook workbook =app.Workbooks.Open(@"C:\Users\Admin\Desktop\Dropbox\Vandit's Folder
...
不幸的是,Chart系列项目没有Z-Index属性。 虽然我发现系列组的排序顺序直接影响z-index顺序。 排序后,第一个系列呈现在顶部,最后一个系列呈现在底部。 如果编辑系列组属性: 然后转到“排序”选项卡,您可以选择按其排序的列。 就我而言,我在DataSet中添加了一个额外的列,用于跟踪我想要的顺序。 我选择了那个: Unfortunately, Chart series items do not have a Z-Index property. Although I have found
...
您可以在图表前面移动图表,或在图表前面移动图表。 但是你要做的是将Shape填入图表的某些组件后面,但仍然在图表背景前面。 据我所知,这是无法做到的。 但您可以通过简单地右键单击并调整属性,使图表的背景和绘图区域透明(无填充,而不是默认的白色填充)来模拟效果。 此外,您可以突出显示图表和形状( Ctrl-Multiple Select )并将两者锁定在一起,这样您的Shape看起来就像是图表的一部分,位于组件后面。 当然,形状将在整个图表本身的后面(通过设置适当的Z值,您可以通过简单地单击“ Re
...