public VirtualChart(IContainer container) { using (PresenterFactory.BeginSharedPresenterTransaction(container, new EmptyPostableForm())) { m_SharedPresenter = PresenterFactory.SharedPresenter; // any size m_ChartDetail = new ChartDetailForm { Size = new Size(1000, 1000) }; } }
public ChartExportDTO ExportToJpgBytes(long viewId, int width, int height) { using (var chartForm = new ChartDetailForm()) { chartForm.Size = new Size(width, height); chartForm.DataSource = CreateChartData(); object id = viewId; chartForm.LoadData(ref id); chartForm.ChartControlSize = new Size(width, height); ChartExportDTO export = chartForm.ExportToJpgBytes(new byte[0], DBChartType.chrBar); return(export); } }
public void Dispose() { if (m_ChartDetail != null) { DataTable oldDataSource = m_ChartDetail.DataSource; if (oldDataSource != null) { m_ChartDetail.DataSource = null; DbDisposeHelper.DisposeTable(ref oldDataSource, true); } m_ChartDetail.Dispose(); m_ChartDetail = null; } if (m_SharedPresenter != null) { m_SharedPresenter.Dispose(); } }