Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Clearing/Deleting Numeric Label
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

FPHealthcare

22 Posts

Posted - 21 Jun 2006 :  16:42:52  Show Profile  Reply with Quote
I've got chart, which when initilised has no data. The InitializeChart sets up the chart view with a blank chart. An event is fired which calls a method which loads new data into the chart, and the chart is redrawn. This all works well.

Part of the chart is number above a bar graph. The numbers aren't related to the bar graph, they just happen to be plotted above them. I'm using Numeric Labels to show these numbers by doing the following

for (int i = 0; i < NumDays; i++)
{
this.AddChartObject(new NumericLabel(
transform, font, ds[i].GetY(), ds[i].GetX(), 1,
ChartObj.PHYS_POS, ChartSupport.DECIMALFORMAT, 2,
ChartSupport.JUSTIFY_CENTER, ChartSupport.JUSTIFY_CENTER, 0));
}

The problem is when the chart is updated with new data, all the plots update fine, but the Numeric Labels remain. The Numeric Labels are plotted in their own transform.

Is there a way to clear everything from transform? Or a way of clearing all Numeric Labels? Or do I have to give each Numeric Label a unique identifier, then call the DeleteChartObject() for each?


quinncurtis

1164 Posts

Posted - 21 Jun 2006 :  17:11:15  Show Profile  Reply with Quote
There is no way to clear all objects that use a specific coordinate system (transform).

There are many other ways of accomplishing what you describe. We would probably just program the InitializeChart routine to plot what ever the current data is. If there is no data, no data is plotted, as in the initial case. Each time InitializeChart is called, preceed the call with with a call to the ChartView.ResetChartObjectList method, which will clear out all objects in the ChartView. If you want the NumericLabels, create them and add them to the ChartView, if you don't want them, then don't add them.

Your suggestion to use DeleteChartObject would also work.


NumericLabels [] labelarray = new NumericLabels[NumDays];

for (int i = 0; i < NumDays; i++)
{
  labelarray[i] = new NumericLabel(
         transform, font, ds[i].GetY(), ds[i].GetX(), 1,
         ChartObj.PHYS_POS, ChartSupport.DECIMALFORMAT, 2,
         ChartSupport.JUSTIFY_CENTER, ChartSupport.JUSTIFY_CENTER, 0);
  this.AddChartObject(labelarray[i]);
}

.
.
.

for (int i = 0; i < NumDays; i++)
{
  this.DeleteChartObject(labelarray[i]);
}



Or, you could just disable/renable the label objects.


.
.
.

for (int i = 0; i < NumDays; i++)
{
  labelarray[i].ChartObjEnable = ChartObj.OBJECT_DISABLE;
//  labelarray[i].ChartObjEnable = ChartObj.OBJECT_ENABLE;

}
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07