Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I have an Excel macro that creates a chart with flexible number o lines (usually up to three lines) and flexible number of points fo each line (may reach 10 points per line). All points and all line should be in different colors. Does someone know of a way to set colors dynamically in a wide colo range that has good distinction between each color? I tried the following code but when I have many points some colors ar very similar and some are even white. " Select Case nLineIndex Case 0: Select Case nPointIndex Case 1: GetPointColor = 3 Case 2: GetPointColor = 10 Case 3: GetPointColor = 53 Case 4: GetPointColor = 39 Case Else: GetPointColor = nPointIndex* 14 + 1 End Select Case 1: Select Case nPointIndex Case 1: GetPointColor = 5 Case 2: GetPointColor = 52 Case 3: GetPointColor = 46 Case 4: GetPointColor = 20 Case Else: GetPointColor = nPointIndex* 10 + 2 End Select Case 2: Select Case nPointIndex Case 1: GetPointColor = 4 Case 2: GetPointColor = 13 Case 3: GetPointColor = 33 Case 4: GetPointColor = 45 Case Else: GetPointColor = nPointIndex* 20 + 3 End Select Case Else: GetPointColor = nPointIndex* nLineIndex* 10 + nLineIndex End Select" Thanks, Ana -- Ana ----------------------------------------------------------------------- Anat's Profile: http://www.excelforum.com/member.php...fo&userid=1670 View this thread: http://www.excelforum.com/showthread.php?threadid=31926 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dynamic Range Selection Using VBA | Excel Discussion (Misc queries) | |||
Dynamic data selection for charts | Charts and Charting in Excel | |||
Make dynamic charts more dynamic | Charts and Charting in Excel | |||
Dynamic Range Selection | Excel Programming | |||
Dynamic Row Selection | Excel Programming |