If I have a chart as below
20 |
15 | X
10 | Z
5 | Y
0 |________________
1.0 2.0 3.0
If X,Y,Z are 3 bubbles plotted in the chart. I want legend to come as
X NameX
Y NameY
Z NameZ
Is this possible?
As of now legend comes as the point of X-axis and Y-axis.
I saw the below pieace of code in forum.
Set li = TChart1.Legend.Item(i)
sItemText = li.Text
It looks like I am not having TeeChart.ILegendItem in my version..
I am using teeChart Pro 5.0 .
Can I manipulate the text comming as legend.
Hi CS,
I'm not sure to understand what do you exactly want. Doesn't this look as you want?
I'm not sure to understand what do you exactly want. Doesn't this look as you want?
Code: Select all
TChart1.AddSeries scBubble
TChart1.Series(0).asBubble.AddBubble 1, 5, 5, "bubble 1", clTeeColor
TChart1.Series(0).asBubble.AddBubble 1, 3, 3, "bubble 2", clTeeColor
TChart1.Series(0).asBubble.AddBubble 0, 1, 4, "bubble 3", clTeeColor
TChart1.Legend.LegendStyle = lsValues
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
I tried this before. If I use as you said the graph comes as
4 | X
3 |-----------Z
2 |
1 |-------Y
0 |________________
-------b b b
-------u u u
-------b b b
-------1 2 3
What ever was there in y axis is gone now. I want to retain that grpah
"-" these dots are put to make the allignment correct.Nothing to do with the requirement.
4 | X
3 |-----------Z
2 |
1 |-------Y
0 |________________
-------b b b
-------u u u
-------b b b
-------1 2 3
What ever was there in y axis is gone now. I want to retain that grpah
"-" these dots are put to make the allignment correct.Nothing to do with the requirement.
Hi CS,
I'm not sure to understand what are you exactly trying to achieve. Please, could you send us an image showing what you would like to do?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance
I'm not sure to understand what are you exactly trying to achieve. Please, could you send us an image showing what you would like to do?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Can I manipulate the text comming as legend.
Sorry for the late reply. Was busy with some other thing.
I have uploaded the "SampleBubbleGraph.JPG" using your upload page. If you see that image you an see legend comming as "-6.102 VWAP" . what I am looking for is legend coming as "3.64 VWAP".
3.64 is value of x-axis. -6.102 is value of y-axis.
What I have tried is
.Series(0).asBubble.AddBubble 3.64,-6.102, 2, "VWAP", RGB(100,4555,111)
I have uploaded the "SampleBubbleGraph.JPG" using your upload page. If you see that image you an see legend comming as "-6.102 VWAP" . what I am looking for is legend coming as "3.64 VWAP".
3.64 is value of x-axis. -6.102 is value of y-axis.
What I have tried is
.Series(0).asBubble.AddBubble 3.64,-6.102, 2, "VWAP", RGB(100,4555,111)
Re: Can I manipulate the text comming as legend.
Hi CS,
These are the legent properties used for most common configurations:
In your case you could include the X values int the labels string and set the legend to display only the labels but then the marks will also show the X values:
So probably the best way to do what you want would be using OnGetLegentText event. Then, you could add your points as you were doing and format the legend text in the event:
These are the legent properties used for most common configurations:
Code: Select all
TChart1.Legend.LegendStyle = lsAuto
TChart1.Legend.TextStyle = ltsXValue
Code: Select all
For i = 0 To 25
X = Rnd * 100
Y = Rnd * 1000
TChart1.Series(0).AddXY X, Y, Str(X) + " VWAP", clTeeColor
Next i
TChart1.Legend.TextStyle = ltsPlain
Code: Select all
Private Sub Form_Load()
For i = 0 To 25
X = Rnd * 100
Y = Rnd * 1000
TChart1.Series(0).AddXY X, Y, "VWAP", clTeeColor
Next i
TChart1.Legend.TextStyle = ltsPlain
End Sub
Private Sub TChart1_OnGetLegendText(ByVal LegendStyle As Long, ByVal ValueIndex As Long, LegendText As String)
LegendText = Str$(TChart1.Series(0).XValues.Value(ValueIndex)) + " " + LegendText
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |