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 === "Column") {
const series1 = new IgxColumnSeriesComponent();
series1.name = "series1";
series1.valueMemberPath = "USA";
series1.title = "USA";
series1.xAxis = this.xAxis;
series1.yAxis = this.yAxis;
const series2 = new IgxColumnSeriesComponent();
series2.name = "series2";
series2.valueMemberPath = "RUS";
series2.title = "Russia";
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 IgxLineSeriesComponent();
series1.name = "series1";
series1.markerType = MarkerType.Circle;
series1.valueMemberPath = "USA";
public initCategorySeries() {
this.columnSeries1 = new IgxColumnSeriesComponent();
this.columnSeries1.dataSource = this.categoryData;
this.columnSeries1.xAxis = this.categoryXAxis;
this.columnSeries1.yAxis = this.numericYAxis;
this.columnSeries1.valueMemberPath = "USA";
this.columnSeries2 = new IgxColumnSeriesComponent();
this.columnSeries2.dataSource = this.categoryData;
this.columnSeries2.xAxis = this.categoryXAxis;
this.columnSeries2.yAxis = this.numericYAxis;
this.columnSeries2.valueMemberPath = "RUS";
this.barSeries1 = new IgxBarSeriesComponent();
this.barSeries1.dataSource = this.categoryData;
this.barSeries1.xAxis = this.numericXAxis;
this.barSeries1.yAxis = this.categoryYAxis;
this.barSeries1.valueMemberPath = "USA";
this.barSeries2 = new IgxBarSeriesComponent();
this.barSeries2.dataSource = this.categoryData;
this.barSeries2.xAxis = this.numericXAxis;
this.barSeries2.yAxis = this.categoryYAxis;
this.barSeries2.valueMemberPath = "RUS";
public setSeries(seriesType: string) {
if (seriesType === "Column") {
const series1 = new IgxColumnSeriesComponent();
series1.name = "series1";
series1.valueMemberPath = "USA";
series1.title = "USA";
series1.xAxis = this.xAxis;
series1.yAxis = this.yAxis;
const series2 = new IgxColumnSeriesComponent();
series2.name = "series2";
series2.valueMemberPath = "RUS";
series2.title = "Russia";
series2.xAxis = this.xAxis;
series2.yAxis = this.yAxis;
this.chart.series.clear();
this.chart.series.add(series1);
this.chart.series.add(series2);
public initCategorySeries() {
this.columnSeries1 = new IgxColumnSeriesComponent();
this.columnSeries1.dataSource = this.categoryData;
this.columnSeries1.xAxis = this.categoryXAxis;
this.columnSeries1.yAxis = this.numericYAxis;
this.columnSeries1.valueMemberPath = "USA";
this.columnSeries2 = new IgxColumnSeriesComponent();
this.columnSeries2.dataSource = this.categoryData;
this.columnSeries2.xAxis = this.categoryXAxis;
this.columnSeries2.yAxis = this.numericYAxis;
this.columnSeries2.valueMemberPath = "RUS";
this.barSeries1 = new IgxBarSeriesComponent();
this.barSeries1.dataSource = this.categoryData;
this.barSeries1.xAxis = this.numericXAxis;
this.barSeries1.yAxis = this.categoryYAxis;
this.barSeries1.valueMemberPath = "USA";