/// <summary> /// Initializes a new instance of the /// <see cref="ChartPanel" /> /// class. /// </summary> /// <param name="sourcebinding">The sourcebinding.</param> public ChartPanel(IChartBinding sourcebinding) : this() { SourceModel = new SourceModel(sourcebinding); Configuration = SourceModel.GetSeriesConfiguration(); ChartData = new SeriesModel(sourcebinding); DataMetric = SourceModel.GetMetric(); TitleInfo = new TitleInfo(DataMetric.Data?.CopyToDataTable()?.TableName); DataSeries = new DataSeries(ChartData); Series.Add(DataSeries); Titles.Add(TitleInfo.GetChartMainTitle()); }
/// <summary> /// Initializes a new instance of the /// <see cref="ChartPanel" /> /// class. /// </summary> /// <param name="model">The model.</param> public ChartPanel(ISourceModel model) : this() { SourceModel = model; Configuration = SourceModel.GetSeriesConfiguration(); ChartData = new SeriesModel(SourceModel.GetSourceBinding()); TitleInfo = new TitleInfo(Configuration.Name); DataMetric = SourceModel.GetMetric(); DataSeries = new DataSeries(ChartData); Series.Add(DataSeries); Titles.Add(TitleInfo.GetChartMainTitle()); }
/// <summary> /// Initializes a new instance of the <see cref="ChartPanel" /> class. /// </summary> /// <param name="data">The data.</param> /// <param name="seriesconfig">The seriesconfig.</param> public ChartPanel(IEnumerable <DataRow> data, ISeriesConfig seriesconfig) : this() { SourceModel = new SourceModel(data, seriesconfig); Configuration = SourceModel.GetSeriesConfiguration(); ChartData = new SeriesModel(data, seriesconfig); DataMetric = SourceModel.GetMetric(); TitleInfo = new TitleInfo(DataMetric.Data?.CopyToDataTable()?.TableName); DataSeries = new DataSeries(ChartData); Series.Add(DataSeries); Titles.Add(TitleInfo.GetChartMainTitle()); }