Commit 0a8a1501 authored by Almouhannad Hafez's avatar Almouhannad Hafez

Update Chart

parent 769bf50f
......@@ -8,7 +8,7 @@ export abstract class Chart {
containerHeight: number;
margin: { top: number; right: number; bottom: number; left: number; };
};
protected data: any[];
public data: any[];
protected width: number;
protected height: number;
protected svg: d3.Selection<d3.BaseType, unknown, HTMLElement, any>;
......@@ -19,7 +19,7 @@ export abstract class Chart {
/**
* Class constructor with basic chart configuration
*/
constructor(_config: ChartConfiguration, _data: any[]) {
constructor(_config: ChartConfiguration, _data?: any[]) {
const vis = this;
......@@ -31,7 +31,7 @@ export abstract class Chart {
containerHeight: height,
margin: _config.margin || vis.getDefaultMargins()
};
vis.data = _data;
vis.data = _data || [];
vis.initChart();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment