I've taken the example code, and am playing with the chart. I want to set the background color of the chart to white.
I've commented out the 'gradient' part, but can't see how to change the panel background color. I get an error (even though this is in the help files in the installation):
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Panel.BackWallColor'
Obviously missing something silly here!!!!
Thanks.
Set Chart1 = CreateObject("TeeChart.TChart")
'=== Extract Chart type =======
ChartType = 1
ViewType = 0
'=== Add Series ==========
Chart1.AddSeries(1)
Chart1.AddSeries(1)
Chart1.AddSeries(1)
'=== Setup Chart view =====
Chart1.Aspect.View3D=0
'=== Do Chart bits and pieces =====
Chart1.Header.Text(0)="TeeChart Series Types"
chart1.walls.visible=true
' Chart1.Walls.Left.Transparent=True
' Chart1.Walls.Left.Color=RGB(35,70,128)
' Chart1.Panel.Gradient.Visible=True
' Chart1.Panel.Gradient.StartColor=&HB3DEF5 '&H8CB4D2
' Chart1.Panel.Gradient.EndColor=&HFACE87
Chart1.Panel.BackWallColor = RGB(255,255,255)
'==== Size will be used for image output formats =====
Chart1.Width = 450
Chart1.Height = 290
'=== use your methods eg via DB to populate Chart or...
' Chart1.Series(0).FillSampleValues 20
with chart1
.Series(1).asBar.StackGroup = 0
.Series(1).asBar.MultiBar = mbStacked
.Series(0).Marks.Visible = false
.Series(1).Marks.Visible = false
.Series(2).Marks.Visible = false
.Legend.Visible=True
.Legend.LegendStyle=3
.Legend.TextStyle=2
.Legend.Alignment=1
.Series(0).add cDbl(objRS("wsBudgetTotal")), "Budget", rgb(0,0,255)
.Series(1).add cDbl(objRS("wsOrderIntakeTotal")), "Actual", rgb(0,255,0)
.Series(2).add cDbl(objRS("wsVarianceTotal")), "Variance", rgb(255,0,0)
.Series(0).asBar.StackGroup = 0
.Series(1).asBar.StackGroup = 1
.Series(2).asBar.StackGroup = 1
end with
How to set the backwall color?
Re: How to set the backwall color?
Hello Keith,
You only need change the color of panel as I do using next code:
Could you please tell us if previous code works in your end?
I hope will helps.
Thanks,
You only need change the color of panel as I do using next code:
Code: Select all
TChart1.Panel.Gradient.Visible = False
TChart1.Panel.Color = RGB(255, 255, 255)
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: How to set the backwall color?
Hi Sandra.
That worked fine. Thanks.
That worked fine. Thanks.
Re: How to set the backwall color?
I have a second issue on the same chart. The 'actual' series value (which is being set as rgb(0,255,0) ) is showing as Green in the chart itself, but in the Legend, it's an amber/orange color.
Any ideas please?
Full code below - thanks.
Response.ContentType = "image/png"
Dim ChartType
Dim OutputStream
Dim ViewType
'=== Create Chart ======
Set Chart1 = CreateObject("TeeChart.TChart")
'=== Extract Chart type =======
ChartType = 1
ViewType = 0
'=== Add Series ==========
Chart1.AddSeries(1)
Chart1.AddSeries(1)
Chart1.AddSeries(1)
'=== Setup Chart view =====
Chart1.Aspect.View3D=0
'=== Do Chart bits and pieces =====
Chart1.Header.Text(0)="KPI Order Intake v Budget"
chart1.walls.visible=true
Chart1.Panel.Gradient.Visible = False
Chart1.Panel.Color = RGB(255, 255, 255)
'==== Size will be used for image output formats =====
Chart1.Width = 450
Chart1.Height = 450
'=== use your methods eg via DB to populate Chart or...
with chart1
.Series(1).asBar.StackGroup = 0
.Series(1).asBar.MultiBar = mbStacked
.Series(0).Marks.Visible = false
.Series(1).Marks.Visible = false
.Series(2).Marks.Visible = false
.Legend.Visible=True
.Legend.LegendStyle=3
.Legend.TextStyle=2
.Legend.Alignment=0
.Series(0).add objRS("wsBudgetTotal"), "Budget", rgb(0,0,255)
.Series(1).add objRS("wsOrderIntakeTotal"), "Actual", rgb(0,255,0)
.Series(2).add objRS("wsVarianceTotal"), "Variance", rgb(255,0,0)
.Series(0).asBar.StackGroup = 0
.Series(1).asBar.StackGroup = 1
.Series(2).asBar.StackGroup = 1
end with
'=== Set output format
OutputStream=Chart1.Export.asPNG.SaveToStream
'=== Cleanup the Chart =====
Set Chart1=Nothing
objRS.Close
Set objRS = nothing
objConn.Close
set objConn = nothing
'===Send off the finished product ====
Response.Binarywrite OutputStream
Any ideas please?
Full code below - thanks.
Response.ContentType = "image/png"
Dim ChartType
Dim OutputStream
Dim ViewType
'=== Create Chart ======
Set Chart1 = CreateObject("TeeChart.TChart")
'=== Extract Chart type =======
ChartType = 1
ViewType = 0
'=== Add Series ==========
Chart1.AddSeries(1)
Chart1.AddSeries(1)
Chart1.AddSeries(1)
'=== Setup Chart view =====
Chart1.Aspect.View3D=0
'=== Do Chart bits and pieces =====
Chart1.Header.Text(0)="KPI Order Intake v Budget"
chart1.walls.visible=true
Chart1.Panel.Gradient.Visible = False
Chart1.Panel.Color = RGB(255, 255, 255)
'==== Size will be used for image output formats =====
Chart1.Width = 450
Chart1.Height = 450
'=== use your methods eg via DB to populate Chart or...
with chart1
.Series(1).asBar.StackGroup = 0
.Series(1).asBar.MultiBar = mbStacked
.Series(0).Marks.Visible = false
.Series(1).Marks.Visible = false
.Series(2).Marks.Visible = false
.Legend.Visible=True
.Legend.LegendStyle=3
.Legend.TextStyle=2
.Legend.Alignment=0
.Series(0).add objRS("wsBudgetTotal"), "Budget", rgb(0,0,255)
.Series(1).add objRS("wsOrderIntakeTotal"), "Actual", rgb(0,255,0)
.Series(2).add objRS("wsVarianceTotal"), "Variance", rgb(255,0,0)
.Series(0).asBar.StackGroup = 0
.Series(1).asBar.StackGroup = 1
.Series(2).asBar.StackGroup = 1
end with
'=== Set output format
OutputStream=Chart1.Export.asPNG.SaveToStream
'=== Cleanup the Chart =====
Set Chart1=Nothing
objRS.Close
Set objRS = nothing
objConn.Close
set objConn = nothing
'===Send off the finished product ====
Response.Binarywrite OutputStream
Re: How to set the backwall color?
Hi,
Note you can ser a color to a series but also to each point in that series. And it's actually what you are doing when adding the points with value, label and color.
Since you haven't set the series' color, the colors of the default palette are taken as the series colors, and so is shown in the legend.
You can set the series' color, ie assigning the color you have in the first point of the series. And the same for the three series.
Note you can ser a color to a series but also to each point in that series. And it's actually what you are doing when adding the points with value, label and color.
Since you haven't set the series' color, the colors of the default palette are taken as the series colors, and so is shown in the legend.
You can set the series' color, ie assigning the color you have in the first point of the series. And the same for the three series.
Code: Select all
With chart1
.Series(0).Color = .Series(0).PointColor(0)
.Series(1).Color = .Series(1).PointColor(0)
.Series(2).Color = .Series(2).PointColor(0)
End With
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: How to set the backwall color?
Thanks - that worked great. Think I''ll need to spend time looking at the tutorials....
Re: How to set the backwall color?
Hi Keith,
You're welcome! I'm glad to hear it works fine!Keith wrote:Thanks - that worked great.
Always recommended. I'd also suggest you to take a look at the features demo to see the possibilities of the component.Keith wrote: Think I''ll need to spend time looking at the tutorials....
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |