Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public setSeries(seriesType: string) {
if (seriesType === "Point") {
const series1 = new IgxScatterSeriesComponent();
series1.name = "series1";
series1.title = "Rich Countries";
series1.markerType = MarkerType.Circle;
series1.dataSource = SampleScatterStats.getCountriesWithHighIncome();
series1.showDefaultTooltip = true;
series1.xMemberPath = "population";
series1.yMemberPath = "gdpTotal";
series1.xAxis = this.xAxis;
series1.yAxis = this.yAxis;
const series2 = new IgxScatterSeriesComponent();
series2.name = "series2";
series2.title = "Poor Countries";
series2.markerType = MarkerType.Circle;
series2.dataSource = SampleScatterStats.getCountriesWithLowIncome();
series2.showDefaultTooltip = true;
series2.xMemberPath = "population";
series2.yMemberPath = "gdpTotal";
series2.xAxis = this.xAxis;
series2.yAxis = this.yAxis;
this.chart.series.clear();
this.chart.series.add(series1);
this.chart.series.add(series2);
} else if (seriesType === "Line") {
const series1 = new IgxScatterLineSeriesComponent();
public setSeries(seriesType: string) {
if (seriesType === "Point") {
const series1 = new IgxScatterSeriesComponent();
series1.name = "series1";
series1.title = "Rich Countries";
series1.markerType = MarkerType.Circle;
series1.dataSource = SampleScatterStats.getCountriesWithHighIncome();
series1.showDefaultTooltip = true;
series1.xMemberPath = "population";
series1.yMemberPath = "gdpTotal";
series1.xAxis = this.xAxis;
series1.yAxis = this.yAxis;
const series2 = new IgxScatterSeriesComponent();
series2.name = "series2";
series2.title = "Poor Countries";
series2.markerType = MarkerType.Circle;
series2.dataSource = SampleScatterStats.getCountriesWithLowIncome();
series2.showDefaultTooltip = true;
public initScatterSeries() {
this.scatterSeries1 = new IgxScatterSeriesComponent();
this.scatterSeries1.dataSource = this.scatterData;
this.scatterSeries1.xAxis = this.numericXAxis;
this.scatterSeries1.yAxis = this.numericYAxis;
this.scatterSeries1.xMemberPath = "Index";
this.scatterSeries1.yMemberPath = "SinValue";
this.scatterSeries1.markerType = MarkerType.Circle;
this.scatterSeries2 = new IgxScatterSeriesComponent();
this.scatterSeries2.dataSource = this.scatterData;
this.scatterSeries2.xAxis = this.numericXAxis;
this.scatterSeries2.yAxis = this.numericYAxis;
this.scatterSeries2.xMemberPath = "Index";
this.scatterSeries2.yMemberPath = "CosValue";
this.scatterSeries2.markerType = MarkerType.Circle;
}
public initScatterSeries() {
this.scatterSeries1 = new IgxScatterSeriesComponent();
this.scatterSeries1.dataSource = this.scatterData;
this.scatterSeries1.xAxis = this.numericXAxis;
this.scatterSeries1.yAxis = this.numericYAxis;
this.scatterSeries1.xMemberPath = "Index";
this.scatterSeries1.yMemberPath = "SinValue";
this.scatterSeries1.markerType = MarkerType.Circle;
this.scatterSeries2 = new IgxScatterSeriesComponent();
this.scatterSeries2.dataSource = this.scatterData;
this.scatterSeries2.xAxis = this.numericXAxis;
this.scatterSeries2.yAxis = this.numericYAxis;
this.scatterSeries2.xMemberPath = "Index";
this.scatterSeries2.yMemberPath = "CosValue";
this.scatterSeries2.markerType = MarkerType.Circle;
}