By insyzygy ar ddydd Sul, 09 Hydref 2022
atebion 1
hoff bethau 0
barn 5K
Pleidleisiau 0
Mae gen i ddata gyda 3 colofn. colofn 1 yw enw'r gyfres, colofn 2 yw x-value, colofn 3 yw y-value. Data gwasgariad XY yw'r data. A ddylwn i uno colofn 1 i un gell?

A allaf blotio'r data hwn ar yr un siart fel bod gennyf gyfresi data xy lluosog gan ddefnyddio Kutools?
Diolch! Rwyf newydd brynu'r meddalwedd felly rwy'n edrych am gymorth.
Hi 'na,

Rydym wedi creu cod VBA, rhowch hwnnw mewn modiwl a gwiriwch ai dyna sydd ei angen arnoch:
Sub KutoolsChart()
'
' CSH
'
Dim xRg As Range
Dim i As Integer
On Error Resume Next
Set xRg = Application.InputBox(prompt:="Please select Range", Title:="Kutools for Excel", Type:=8)
If TypeName(xRg) = "Nothing" Then Exit Sub
If xRg.Columns.Count <> 3 Then
MsgBox ("Reference is not Valid")
Exit Sub
End If
ActiveSheet.Shapes.AddChart2(240, xlXYScatter).Select

For i = 1 To xRg.Rows.Count
ActiveChart.SeriesCollection.NewSeries
ActiveChart.FullSeriesCollection(i).Name = xRg.Cells(i, 1).Value
ActiveChart.FullSeriesCollection(i).XValues = xRg.Cells(i, 2)
ActiveChart.FullSeriesCollection(i).Values = xRg.Cells(i, 3)
ActiveChart.FullSeriesCollection(i).ApplyDataLabels
ActiveChart.FullSeriesCollection(i).DataLabels.Select
ActiveChart.FullSeriesCollection(i).DataLabels.ShowValue = False
ActiveChart.FullSeriesCollection(i).HasLeaderLines = False
ActiveChart.FullSeriesCollection(i).DataLabels.ShowSeriesName = True
Next
End Sub

Ar ôl i chi gopïo a gludo'r cod uchod, pwyswch F5 i redeg y cod. A bydd blwch deialog yn ymddangos yn gofyn ichi ddewis y tair colofn.

Os oes gennych unrhyw gwestiynau, peidiwch ag oedi i ofyn i mi.

Amanda
·
1 flwyddyn yn ôl
·
0 hoffi
·
0 Pleidlais
·
0 Sylwadau
·
Gweld y Post Llawn