By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,788 Members | 1,453 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,788 IT Pros & Developers. It's quick & easy.

More then 4000 point displayed on scatter graph

P: 1
Does anybody know haw to display more then 4000 points on scatter graph?
May 21 '07 #1
Share this Question
Share on Google+
3 Replies

NeoPa
Expert Mod 15k+
P: 31,770
I'm afraid not.
I hope you find your solution somewhere. Good luck.
Jun 2 '07 #2

FishVal
Expert 2.5K+
P: 2,653
Yes this is the limit for MSGraph Chart control, but you can use MSExcel Chart which accepts more data.

The solution maybe somthing like this.

oleXLGraph - the name of unbound object frame control of class Excel Chart containing worksheet named "Chart" and worksheet named "Data"

tblData: table containing raw data with field "sglX " for XValues and "sglY" for YValues

the example is fully working with records number >10000 (I've not tried more ;-)), it is obviously limited by row number in XL sheet


the following code for OnOpen event submit data into the chart
Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Form_Open(Cancel As Integer)
  3.  
  4. Dim wkbGraph As Excel.Workbook
  5. Dim wksData As Excel.Worksheet
  6. Dim chtChart As Excel.Chart
  7. Dim rs As New ADODB.Recordset
  8. Dim lngRowsCopied As Long
  9.  
  10. Set wkbGraph = Me.oleXLGraph.Object
  11. Set wksData = wkbGraph.Worksheets("Data")
  12. Set chtChart = wkbGraph.Charts("Chart")
  13.  
  14. rs.Open "SELECT sglX, sglY FROM tblData", CurrentProject.Connection, _
  15. adOpenForwardOnly, adLockReadOnly
  16.  
  17. lngRowsCopied = wksData.Range("A1").CopyFromRecordset(rs)
  18. 'MsgBox lngRowsCopied
  19.  
  20. With chtChart.SeriesCollection(1)
  21. .XValues = "=Data!R1C1:R" & lngRowsCopied & "C1"
  22. .Values = "=Data!R1C2:R" & lngRowsCopied & "C2"
  23. End With
  24.  
  25. rs.Close
  26.  
  27. Set wkbGraph = Nothing
  28. Set wksData = Nothing
  29. Set wksData = Nothing
  30. Set rs = Nothing
  31.  
  32. End Sub
  33.  
  34.  
I can send you a whole mdb if you want. My e-mail: [email removed]
Jun 2 '07 #3

P: 1
I used the code supplied by FishVal and it works very well. Thank you so much! However, to get it to work I need to open Excel. Is there anyway to get the Excel Chart to work in Access without having to have Excel open?
Dec 18 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.