Bubble value displayed within the bubble itself

TeeChart for ActiveX, COM and ASP
Chuck
Newbie
Newbie
Posts: 18
Joined: Tue Dec 13, 2005 12:00 am

Bubble value displayed within the bubble itself

Post by Chuck » Tue Aug 22, 2006 10:01 am

Hi I am trying to display the numerical value on top of each bubble that is displayed within a grid. is this possible with the bubble charts

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Aug 22, 2006 11:06 am

Hi Chuck,

Yes, this is possible using series marks as shown here:

Code: Select all

Private Sub Form_Load()
    With TChart1.Series(0)
        .FillSampleValues 10
        .Marks.Visible = True
        
        'You can play with ArrowLength to position the marks
        .Marks.ArrowLength = -5
        .Marks.Arrow.Visible = False
    End With
End Sub
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chuck
Newbie
Newbie
Posts: 18
Joined: Tue Dec 13, 2005 12:00 am

Post by Chuck » Tue Aug 22, 2006 12:14 pm

Hi Thanks, This is something like what I want but this is displaying the Ax value of the bubble. i wish it to display the ARadius value of the bubble. See code below.

pointColor= Convert.ToUInt32(System.Drawing.ColorTranslator.ToOle(SeriesColor(seriesNum)));
axTChart2.Series(seriesNum).ColorEachPoint = false;
axTChart2.Series(seriesNum).asBubble.AddBubble(Convert.ToDouble(dr[X]),Convert.ToDouble(dr[Y]),(Convert.ToDouble(dr[Mag])/fr)/2, "",16777215);
axTChart2.Series(seriesNum).asBubble.Pointer.Pen.Color = pointColor;
axTChart2.Series(seriesNum).asBubble.Pointer.Pen.Style = TeeChart.EChartPenStyle.psSolid;
axTChart2.Series(seriesNum).asBubble.Pointer.Pen.Width = 1;
axTChart2.Series(seriesNum).asBubble.Pointer.Pen.Visible = true;
axTChart2.Series(seriesNum).Marks.Visible = true;

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Aug 22, 2006 2:02 pm

Hi Chuck,

Ok, you can achieve that using the OnGetSeriesMark event as shown here:

Code: Select all

		private void Form1_Load(object sender, System.EventArgs e)
		{
			this.axTeeCommander1.Parent=this.axTChart1;

			this.axTChart1.Series(0).FillSampleValues(10);
			this.axTChart1.Series(0).Marks.Visible=true;
		}

		private void axTChart1_OnGetSeriesMark(object sender, AxTeeChart.ITChartEvents_OnGetSeriesMarkEvent e)
		{
			e.markText = this.axTChart1.Series(0).asBubble.RadiusValues.get_Value(e.valueIndex).ToString();
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chuck
Newbie
Newbie
Posts: 18
Joined: Tue Dec 13, 2005 12:00 am

Post by Chuck » Tue Aug 22, 2006 2:12 pm

Thanks for this but I don't see how I can encorporate this within my code. I am looping through each series so where would the onGetSeriesMark event be caled from there??

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Aug 22, 2006 2:22 pm

Hi Chuck,

OnGetSeriesMark is called for every series so you can use e.seriesIndex:

Code: Select all

		private void axTChart1_OnGetSeriesMark(object sender, AxTeeChart.ITChartEvents_OnGetSeriesMarkEvent e)
		{
			e.markText = this.axTChart1.Series(e.seriesIndex).asBubble.RadiusValues.get_Value(e.valueIndex).ToString();
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chuck
Newbie
Newbie
Posts: 18
Joined: Tue Dec 13, 2005 12:00 am

Post by Chuck » Tue Aug 22, 2006 2:31 pm

Thanks but this is still not working. See my code below:

foreach(DataRow dr in datarows)
{
if (getPageName(dr) == pg)
{
if (dr[X] != System.DBNull.Value && dr[Y]!= System.DBNull.Value && dr[Mag] != System.DBNull.Value)
{
string sery = getCurveName(dr);
System.UInt32 pointColor;
int seriesNum = series.IndexOf(sery);
if (seriesNum < 0)
{
seriesNum = series.Add(sery);
axTChart2.AddSeries(TeeChart.ESeriesClass.scBubble);
axTChart2.Series(seriesNum).Title = sery;
}
pointColor= Convert.ToUInt32(System.Drawing.ColorTranslator.ToOle(SeriesColor(seriesNum)));
axTChart2.Series(seriesNum).ColorEachPoint = false;
axTChart2.Series(seriesNum).asBubble.AddBubble(Convert.ToDouble(dr[X]),Convert.ToDouble(dr[Y]),(Convert.ToDouble(dr[Mag])/fr)/2, "",16777215);
axTChart2.Series(seriesNum).asBubble.Pointer.Pen.Color = pointColor;
axTChart2.Series(seriesNum).asBubble.Pointer.Pen.Style = TeeChart.EChartPenStyle.psSolid;
axTChart2.Series(seriesNum).asBubble.Pointer.Pen.Width = 1;
axTChart2.Series(seriesNum).asBubble.Pointer.Pen.Visible = true;
axTChart2.Series(seriesNum).Marks.Visible = true;
}
}
}


private void axTChart2_OnGetSeriesMark(object sender, AxTeeChart.ITChartEvents_OnGetSeriesMarkEvent e,int seriesnum)
{
e.markText = this.axTChart2.Series(e.seriesIndex).asBubble.RadiusValues.get_Value(e.valueIndex).ToString();
}

How is the OnGetSeriesMark called from the main chart creation?

Realy appreciate your help here!!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Aug 22, 2006 2:47 pm

Hi Chuck,

You can define the event at the design view, at the AxTChart properties window or at run-time like this:

Code: Select all

		private void Form1_Load(object sender, System.EventArgs e)
		{
			this.axTeeCommander1.Parent=this.axTChart1;

			this.axTChart1.Series(0).FillSampleValues(10);
			this.axTChart1.Series(0).Marks.Visible=true;

			this.axTChart1.OnGetSeriesMark += new AxTeeChart.ITChartEvents_OnGetSeriesMarkEventHandler(axTChart1_OnGetSeriesMark);
		}

		private void axTChart1_OnGetSeriesMark(object sender, AxTeeChart.ITChartEvents_OnGetSeriesMarkEvent e)
		{
			e.markText = this.axTChart1.Series(e.seriesIndex).asBubble.RadiusValues.get_Value(e.valueIndex).ToString();
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chuck
Newbie
Newbie
Posts: 18
Joined: Tue Dec 13, 2005 12:00 am

Post by Chuck » Tue Aug 22, 2006 3:22 pm

Hi Hate to keep at this but I amgetting Object reference not set to an instance of an object when the event handler is generated. is there any other method of retreiving this value?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Aug 22, 2006 3:30 pm

Hi Chuck,

Could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at news://www.steema.net/steema.public.attachments newsgroup.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chuck
Newbie
Newbie
Posts: 18
Joined: Tue Dec 13, 2005 12:00 am

Post by Chuck » Tue Aug 22, 2006 3:32 pm

Is it possible to send via email. I have no access to newsgroups

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Aug 23, 2006 7:28 am

Hi Chuck,

Ok, please send your example to me.
Last edited by Narcís on Wed Oct 04, 2006 11:04 am, edited 1 time in total.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chuck
Newbie
Newbie
Posts: 18
Joined: Tue Dec 13, 2005 12:00 am

Post by Chuck » Wed Aug 23, 2006 11:00 am

Hi I was just wondering if that code got to you via e-mail?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Aug 23, 2006 11:22 am

Hi Chuck,

Yes I received the code and we will review it and reply here ASAP.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Chuck
Newbie
Newbie
Posts: 18
Joined: Tue Dec 13, 2005 12:00 am

Post by Chuck » Thu Aug 24, 2006 10:14 am

Hi narcis, Iw as wondering if you could come up with a solution to the bubble plot not showing radius marks for me.

Thanks..

Post Reply