Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSChart Control.SelectPart Errors,,,?

Status
Not open for further replies.

GWhiz

Programmer
Dec 16, 1999
49
US
Hi, folks!

I'm trying to use the .SelectPart method on an MSChart control. The syntax in the reference to that method must be incorrect -- I keep getting an error for a missing "=" sign, and then get "Type Mismatch" error in every syntax where I use the "=" sign.

I'm trying to use a FlexGrid to select a datapoint from a list of datapoints, then use the info from the appropriate column of the FlexGrid to highlight or setfocus on the corresponding datapoint in the chart displaying the data in the FlexGrid.

FlexGrid returns the correct data, and MSChart is plotting the data, but I cannot get the two to interact in any kind of useful way (such as selecting a datapoint on the Chart, and moving to the associated datapoint in the Grid, or selecting the datapoint in the Grid, and highlighting the associated datapoint in the Chart.

Anyone have any experience with this?

Thanks sooooo much!

Respectfully,

GWhiz
 
Do you have the parameters for the SelectPart method enclosed in parentheses, like this?

MSChart1.SelectPart(var1, var2, var3, var4, var5)

If so, try removing the parentheses:

MSChart1.SelectPart var1, var2, var3, var4, var5

and don't use any equal sign (e.g., x = MSChart1.SelectPart..)

Let me know if this works for you.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
jebenson:

Thank you very much for your suggestion. Yes, I was using parentheses around the arguments, and your suggestion immediately eliminated the error messages, which is certainly a big improvement.

My chart still doesn't highlight the selected datapoint like I would have expected -- I'm displaying over 1,000 datapoints, crammed into 2/3 of a screen, so there aren't enough actual pixels to display every point, though the chart tries. So maybe that's why individual points aren't highlighting like I would expect.

I looked in the archives for info relating to MSChart -- seems there are a LOT of questions about how to make that thing work right, and relatively few answers.

Such is life. Thanks again for your suggestion...
 
jebenson:

A follow-up here. I got my datapoints to select reliably when I increased the divisions per tick -- I had it set so that it was drawing a vertical black line on every datapoint, so that the entire background appeared black. This density of information was evidently interfering with the ability to actually select a particular datapoint.

Respectfully,

GWhiz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top