TeeChart for ActiveX, COM and ASP
-
TMECHAM
- Newbie
- Posts: 20
- Joined: Tue Aug 17, 2004 4:00 am
Post
by TMECHAM » Fri Jun 03, 2005 6:40 pm
Ok, I'm at a loss as to why my bar series is always black ... I am using the solid brush with Lime as the color and the bars are always black no matter what I seem to do. Please help :x BTW I'm using v7.0.0.4
Here is my .tee file:
Code: Select all
object TChartChart
Left = 5
Top = 5
Width = 807
Height = 456
AllowPanning = pmNone
BackWall.Transparent = False
Title.Font.Color = clBlack
Title.Text.Strings = (
'Advanced Graph')
BottomAxis.Automatic = False
BottomAxis.AutomaticMaximum = False
BottomAxis.AutomaticMinimum = False
BottomAxis.Grid.Color = clBlack
BottomAxis.Maximum = 38506.501388888880000000
BottomAxis.Minimum = 38506.494444444440000000
BottomAxis.MinorTicks.Color = clBlack
BottomAxis.Ticks.Color = clBlack
LeftAxis.Grid.Color = clBlack
LeftAxis.MinorTicks.Color = clBlack
LeftAxis.Ticks.Color = clBlack
Legend.LegendStyle = lsSeries
RightAxis.Grid.Color = clBlack
RightAxis.Grid.Visible = False
RightAxis.MinorTicks.Color = clBlack
RightAxis.Ticks.Color = clBlack
Zoom.Animated = True
BevelWidth = 0
Color = clSilver
object Series0: TBarSeries
BarBrush.Color = clLime
BarPen.Color = clLime
BarPen.Width = 0
Marks.Callout.Brush.Color = clLime
Marks.Visible = False
SeriesColor = clLime
Title = 'Bar'
Gradient.Direction = gdTopBottom
XValues.DateTime = True
XValues.Name = 'X'
XValues.Order = loAscending
YValues.Name = 'Bar'
YValues.Order = loNone
Data = {
030A000000D8822DD84FCDE240D7A3703D0A77524000000000DEDDDDDD4FCDE2
400AD7A3703D7A524000000000E4388EE34FCDE240A4703D0AD7735240000000
00E9933EE94FCDE240713D0AD7A370524000000000EFEEEEEE4FCDE24048E17A
14AE77524000000000F5499FF44FCDE240A4703D0AD773524000000000FAA44F
FA4FCDE24085EB51B81E755240000000000000000050CDE240F6285C8FC27552
4000000000065BB00550CDE2405C8FC2F5287C5240000000000BB6600B50CDE2
401F85EB51B87E524000000000}
end
end
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Mon Jun 06, 2005 10:31 am
Hi,
I have been able to reproduce the problem importing your .tee file but haven't been able to reproduce it from scratch. I've already posted a project trying to reproduce it at [url]news://
www.steema.net/steema.public.attachments[/url] newsgroup. Exporting the chart will also create a .txt copy of the .tee file. Could you please have a look at it and let me know if you can reproduce the problem on this project?
Thanks in advance.
-
TMECHAM
- Newbie
- Posts: 20
- Joined: Tue Aug 17, 2004 4:00 am
Post
by TMECHAM » Mon Jun 06, 2005 4:07 pm
I found the problem. All you have to do is set the series color property.
Code: Select all
Private Sub Form_Load()
TeeCommander1.Chart = TChart1
'Set the series color and you will see the problem!
TChart1.Series(0).Color = clLime
TChart1.Series(0).asBar.BarPen.Width = 0
TChart1.Series(0).asBar.BarBrush.Color = clLime
TChart1.Series(0).Marks.Callout.Brush.Color = clLime
TChart1.Panel.BevelWidth = 0
TChart1.Series(0).FillSampleValues 5
End Sub
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Tue Jun 07, 2005 11:59 am
Hi,
Ah, ok, I've noticed the problem. It doesn't work because you are using Visual Basic and clLime is not a Visual Basic color, it's a Delphi color.
What happens is that TeeChart Pro ActiveX is a wrapper from VCL native version and thus, when creating a .tee file, internally uses Delphi enumerations which can't be used in VB, you should use VB enumerations or set your colors using the chart editor.
-
TMECHAM
- Newbie
- Posts: 20
- Joined: Tue Aug 17, 2004 4:00 am
Post
by TMECHAM » Tue Jun 07, 2005 3:56 pm
Ok, so using your example, if I clear the graph, and import the .tee file I attached here to this thread, what property would I change to get the bars to show up in a color other than black? My project isn't even in VB, I was just modifying your project to try to reproduce the problem.
So what I do is save the attached .tee file as c:\barcolor.tee, then clear the graph and import. Then I bring up the properties for the graph and try to get the bar color to change and I can't do it.
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Wed Jun 08, 2005 7:07 am
Hi,
It works here changing the series color after importing the chart, doing:
Code: Select all
Private Sub Command3_Click()
TChart1.Import.LoadFromFile ("C:\BarColor.tee")
TChart1.Series(0).Color = vbRed
End Sub
If your project is not in VB the syntax wouldn't be the same but should work identically.
-
TMECHAM
- Newbie
- Posts: 20
- Joined: Tue Aug 17, 2004 4:00 am
Post
by TMECHAM » Wed Jun 08, 2005 3:11 pm
I still see black even when I do all of the following. The only color that seems to be affected by the following is the pen color. It shows up as red, but the bar remains black
Code: Select all
Private Sub Command3_Click()
TChart1.Import.LoadFromFile ("C:\BarColor.tee")
TChart1.Series(0).Color = vbRed
TChart1.Series(0).asBar.BarPen.Color = vbRed
TChart1.Series(0).asBar.BarBrush.Color = vbRed
End Sub
-
Narcís
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
-
Contact:
Post
by Narcís » Thu Jun 09, 2005 1:57 pm
Hi TMECHAM,
I've already replied to your last attachments newsgroups message with the working example. Could you please have a look at it and let me know if it doesn't work for you?
-
Pep
- Site Admin
- Posts: 3303
- Joined: Fri Nov 14, 2003 5:00 am
-
Contact:
Post
by Pep » Fri Jun 17, 2005 2:55 pm
Hi Tyler,
please see my answer at the steema.public.attachments newsgroup.