Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to show markers for one series and not for another

A part of my current assignment is to, once all data has been calculated successfully (it has), is to plot a scatter showing altitude against time.

This plot requires two series. One for the trajectory start to finish and another to show the apogee.

I have managed to get the chart to show this by defining the scatter as xlXYScatterSmooth. I would prefer the full length series to have no markers though.

How do I do this?

Dim Chart1 As Chart
Dim xaxis As Range
Dim yaxis As Range
Dim MAXyaxis As Range
Dim Series As Series
Dim SeriesMAX As Series

Set yaxis = DisplayCorrectedAlt
Set xaxis = Range(Cells(1, 1), Cells(RowCount, 1))
Set MAXyaxis = Cells(1, 9)
Set MAXxaxis = Cells(1, 10)

Set Chart1 = Charts.Add
    With Chart1
        .ChartType = xlXYScatterSmooth
    End With

Set Series = Chart1.SeriesCollection.NewSeries
    With Series
        .Values = yaxis
        .XValues = xaxis
    End With

Set SeriesMAX = Chart1.SeriesCollection.NewSeries
    With SeriesMAX
        .Values = MAXyaxis
        .XValues = MAXxaxis

    End With
like image 855
Reece Grimshaw Avatar asked Dec 08 '25 08:12

Reece Grimshaw


1 Answers

You can use .MarkerStyle = xlMarkerStyleNone against the DataSeries object.

Place it inside the With block of the desired series, like this:

With SeriesMAX
    .Values = MAXyaxis
    .XValues = MAXxaxis
    .MarkerStyle = xlMarkerStyleNone
End With
like image 184
Scott Holtzman Avatar answered Dec 09 '25 22:12

Scott Holtzman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!