Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Bar plots with each bar different color

Hi,

How can I plot a data set using bar graph in which every bar has a different color? I should be able to choose the colors for bars.

Thank you

Cem
0 Kudos
Message 1 of 6
(6,970 Views)
Hi Cem,

I'm afraid you can't change the colour for each bar on the graph. The colour property is associated to the entire graph not just a specific point. The only way I can think of that might work would be to make each point a separate plot. Each plot (bar) could then have it's own colour. This would probably work in theory but practically I don't think it's viable option especially if you have a lot a points to plot.

John
0 Kudos
Message 2 of 6
(6,954 Views)
John,

Thank you for the hint. I already tried plotting bars as diferent plots. I would plot maximum of 15 bars. So it is feasible but for some reason bars are coming out as vertical lines. The program is attached. I appreaciate your help, thank you.

Cem
0 Kudos
Message 3 of 6
(6,951 Views)
Cem,

It seems that the way the bar graph works relies on there being more than one point to 'close' the bars. Because you are only plotting one point per plot the bar can't be 'closed'. A way round this might be to make each plot have two points spanning over one interval and let each plot overlap the next.

eg. Plot 1 (1,1 ; 2,1)
Plot 2 (2,5 ; 3,5)
Plot 3 (3,4 ; 4,4)
.
.
.

I haven't tried this myself but I think it should work.

John
0 Kudos
Message 4 of 6
(6,945 Views)
John,

Thank you. Based on your advice here is the solution. I combined it with multiple style plots.

Thanks again.

Cem
0 Kudos
Message 5 of 6
(6,945 Views)
Excellent!! I'm glad you managed to get it working. Thanks a lot for sending me the final solution.
0 Kudos
Message 6 of 6
(6,938 Views)