isSeriesInRows property
bool
get
isSeriesInRows
True if chart has a series in row. False otherwise. Read-only.
Implementation
bool get isSeriesInRows {
return _bSeriesInRows;
}
set
isSeriesInRows
(bool value)
Sets chart has a series in row.
Workbook workbook = Workbook();
Worksheet sheet = workbook.worksheets[0];
sheet.getRangeByName('A1').text = 'Items';
sheet.getRangeByName('B1').text = 'Count';
sheet.getRangeByName('A2').text = 'Beverages';
sheet.getRangeByName('A3').text = 'Condiments';
sheet.getRangeByName('A4').text = 'Confections';
sheet.getRangeByName('B2').number = 2776;
sheet.getRangeByName('B3').number = 1077;
sheet.getRangeByName('B4').number = 2287;
ChartCollection charts = ChartCollection(sheet);
Chart chart = charts.add();
chart.chartType = ExcelChartType.bar;
chart.dataRange = sheet.getRangeByName('A1:B4');
chart.isSeriesInRows = false;
sheet.charts = charts;
List<int> bytes = workbook.saveAsStream();
File('Chart.xlsx').writeAsBytes(bytes);
workbook.dispose();
Implementation
set isSeriesInRows(bool value) {
final int iCount = _series.count;
if (dataRange == null && iCount != 0) {
final Error error = ArgumentError(
'This property supported only in chart where can detect data range.');
throw error;
}
if (_bSeriesInRows != value) {
_bSeriesInRows = value;
if (iCount != 0) {
_onDataRangeChanged(chartType);
}
}
}