Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bar Chart Colors

Hello QV Experts,

Below code I am using for drawing  combo charts. How do I change default Chart bar colors by writing code?

  Manually I configure this way =>  Chart properties -> Colors -> Data Appearance -> Colors 1-6. But how do I automate this?

Any help highly appreciated.

    

set chart = ActiveDocument.Sheets(0).CreateComboChart
set p = chart.GetProperties
 
p.GraphLayout.WindowTitle.v = chartName
p.GraphLayout.Frame.TextAdjustHorizontal = 1

chart.SetProperties p

Thanks

1 Solution

Accepted Solutions
Not applicable
Author

Hello QV

I found a way to achive this below is the code, this might help other. hence sharing

set colors = p.ChartProperties.ColorMap

colors(0).PrimaryCol.Col = RGB(0,73,147)  

colors(1).PrimaryCol.Col = RGB(178,36,36)

chart.SetProperties p

View solution in original post

1 Reply
Not applicable
Author

Hello QV

I found a way to achive this below is the code, this might help other. hence sharing

set colors = p.ChartProperties.ColorMap

colors(0).PrimaryCol.Col = RGB(0,73,147)  

colors(1).PrimaryCol.Col = RGB(178,36,36)

chart.SetProperties p