Tom
Tom

Reputation: 4043

Change type of points of highchart's scatter chart

I'm using highcharts to display some kind of scatter chart.

I have multiple series, but I want all of their points to be dots, just like for the first point/line and last point/line (no triangles etc.), how can I do so?

export class EmpiricalChartComponent implements OnInit {

  Highcharts: typeof Highcharts = Highcharts;
  chartOptions: Highcharts.Options;

  constructor() {
  }

  ngOnInit(): void {
    this.chartOptions = {
      plotOptions: {
        scatter: {
          lineWidth: 2
        }
      },
      yAxis: {
        min: 0,
        title: {
          text: ''
        }
      },
      series: [
        {
          type: 'scatter',
          data: [...]
        }, {
          type: 'scatter',
          data: [...]
        }, {
          type: 'scatter',
          data: [...]
        },
      ]
    };

}



Current graph: enter image description here

Upvotes: 0

Views: 317

Answers (1)

Sapikelio
Sapikelio

Reputation: 2604

You should add marker property inside each serie with symbol: 'circle' like this:

 this.chartOptions = {
      plotOptions: {
        scatter: {
          lineWidth: 2
        }
      },
      yAxis: {
        min: 0,
        title: {
          text: ''
        }
      },
      series: [
        {
          type: 'scatter',
          data: [...],
          marker: {
            symbol: 'circle'
          }
        }, {
          type: 'scatter',
          data: [...],
          marker: {
            symbol: 'circle'
          }
        }, {
          type: 'scatter',
          data: [...],
          marker: {
            symbol: 'circle'
          }
        },
      ]
    };

Upvotes: 1

Related Questions