根据值更改图表栏颜色 [英] Change chart bar color base on value

查看:72
本文介绍了根据值更改图表栏颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的报告上有一个柱形图,并希望根据值将颜色更改为红色,黄色和绿色

I have a column chart on my report and would like to change color to red, yellow and green base on the value

我尝试使用以下值,它只是更改列的边框并更改整个图表。

I tried to use following value, it only change the border of column and change entire chart.

MyChart.SeriesCollection(1).Border.Color = vbRed

MyChart.SeriesCollection(1).Border.Color = vbRed

我的表结果如下

MyElement  MyValue

MyElement  MyValue

   E1               2

   E1               2

   E2               4

   E2               4

   E3               5

   E3               5

我想为红色显示2的不同颜色,黄色显示4种颜色,绿色显示5种颜色。

I wanted to show different color for 2 for red, 4 for Yellow and 5 for Green.

有没有办法修改颜色对于一个简单的柱形图值?

Are there any way to modify the color for a simple column chart by value?

非常感谢您的帮助和信息,

Your help and information is great appreciated,

问候,

Sourises,

推荐答案

嗨Sourises,

请尝试获取系列的Points对象并更改其中任何一个的格式并检查结果。

MyChart.SeriesCollection(1).Points(1).Format.Fill.ForeColor=vbRed

问候

Starain


这篇关于根据值更改图表栏颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆