Identifying data points on a chart

pcc

Well-known Member
Joined
Jan 21, 2003
Messages
1,382
Office Version
  1. 2021
Platform
  1. Windows
I need to plot a chart as a scatter chart. The chart is busy, and I don't want to display either data values or labels on it, since they will clutter it up too much. However, if possible, I would like to be able to hover the pointer over any point, and show additional info. for the point. eg by default, if I hover over a point, the yellow box that appears might say "Series 2 point 8 (8,50)" I would like it to say say "Series 2 point 8 (8,50) - other text here"
Anyone have any suggestions on how this might be achieved??

Thanks
 
Andrew
Your code is very useful - Thank you - however I have multiple charts on my worksheet - how can I change the code to recognize the chart I select? - using the mouse.
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Andrew
I used you code in my code where I test new functions and develop them - the code works great - for when I click on a datapoint in a series.

Next I hooked up the class module in my big code - my charts are very large and scattered all over my worksheet - for this reason I read the data into arrays and then set the .values and/or .Xvalues - your code works great but I now get the Excel message that my text string is to long - however when I press ok - and then look at the data point - I get the info requested. So I am not sure it is your code - or maybe it is simply Excel.

I get the exact same message if my array has more than 16384 elelements in it - even thus MS claim that you can have up to 32K datapoints in a single series - I have messed around with the 16384 (2^14) problem a lot - but cannot find a solution to chart more than 16384 data points in a single series - If my array is say 23K points I get no errors no nothing - but when I check the number of data points with the .SeriesCollection(PlotCounter).Points.Count function then it only show 16384 datapoints. If I then click on a series - I get the exact message I now get having implemented your code.

I am giving you all this info as it may not be your code creating the Excel message - but a real bug in xl2007.

However any comments would be much appreciated - The 2^14 problem has meant that I now create multiple charts - each max 16384 datapoints in a single series - when the user select all the data.
 
Upvote 0
Andrew
One more question regarding the datapoint - I love the code btw - My big code resides in a Add-In XLAM file - so I really dont want any code in my sheets that I apply the code to. So here are the missing points

How do I fire the event(s) on a workbook with no code and multiple charts

I hope you can help me out here - I have never used a Class Module before.

The code below is what I pasted into the data source sheet and also where the chart resides - but that is the code I need to have somewhere in my XLAM file


Sheet
Code:
Dim MyChart As New Class1
Private Sub Worksheet_Activate()
    Set MyChart.Ch = ActiveSheet.ChartObjects(1).Chart
End Sub
 
Upvote 0
Andrew Poulsom,

I implemented your code above, and it's mostly working; but, occassionally, when I click on a data point, I get the dreaded "Microsoft Excel has stopped working" message.

Have you ever encountered this? Do you know how to fix it?
 
Upvote 0
I have the code in a new Class Module (Class1) but how do I cause the chart to fire the code?
A LOT more familiar with events in Access but this has me stumped!
I simply do not see how to call the code from a simple bar chart.
Thanks
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top