protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Load Data WareHouse Helpers.SetDataSource(cboDataDW, MyBI.Me.GetDW(), "Value", "Text"); WHCode = Get_Param(PageArgs.WHCode); if (!string.IsNullOrEmpty(WHCode)) { cboDataDW.Value = WHCode; gridPortletList.DataSource = MyBI.Me.Get_Widget(WHCode); gridPortletList.DataBind(); IQueryable<lsttbl_Widget> widgets = MyBI.Me.Get_Widget(WHCode); foreach (lsttbl_Widget wg in widgets) { if (wg.WidgetType == "gauge") { WidgetGauge wgGauge = wg.JsonObj_Gauge; } else if (wg.WidgetType == "chart") { WidgetChart wgChart = wg.JsonObj_Chart; } else { // grid WidgetGrid wgGrid = wg.JsonObj_Grid; } } } } }
public override WidgetBase GetInputSett() { var obj = new WidgetChart { AppearanceName = Lib.NTE(this.cboAppearance.Value), PaletteName = Lib.NTE(this.cboPalette.Value), RotatedXY = this.chkRotatedXY.Checked, XTitle = this.txtTitleX.Text, XFields = this.Get_XFields(), YTitle = this.txtTitleY.Text, YFields = this.Get_YFields(), YUnitName = this.txtYUnit.Text, Width = int.Parse(this.txtWidth.Text), Height = int.Parse(this.txtHeight.Text), ShowSeriesLabel = this.chkShowSeriesLabel.Checked }; return obj; }
public override WidgetBase GetInputSett() { var obj = new WidgetChart { AppearanceName = Lib.NTE(this.cboAppearance.Value), PaletteName = Lib.NTE(this.cboPalette.Value), RotatedXY = this.chkRotatedXY.Checked, XTitle = this.txtTitleX.Text, XFields = this.Get_XFields(), YTitle = this.txtTitleY.Text, YFields = this.Get_YFields(), YUnitName = this.txtYUnit.Text, Width = int.Parse(this.txtWidth.Text), Height = int.Parse(this.txtHeight.Text), ShowSeriesLabel = this.chkShowSeriesLabel.Checked }; return(obj); }
public static WidgetChart Get_WidgetChart() { // Chuẩn bị dữ liệu (sau này sẽ lấy từ database) var ds = GlobalSsn.Get_InqDefineSource(); var objX = ds.Fields[0]; var objX1 = ds.Fields[1]; var objY = ds.Summaries[1]; // Khởi tạo đối tượng 'WidgetChart' với bộ dữ liệu. var ret = new WidgetChart(); //ret.RotatedXY = true; ret.SelectCommand = ds.ToSql(); ret.XTitle = objX.ColAliasVI; ret.YTitle = objY.FieldAlias; ret.AddXField(objX.ColName); ret.AddXField(objX1.ColName); ret.AddYField(objY.FieldAlias); return(ret); }
public static WidgetChart Get_WidgetChart() { // Chuẩn bị dữ liệu (sau này sẽ lấy từ database) var ds = GlobalSsn.Get_InqDefineSource(); var objX = ds.Fields[0]; var objX1 = ds.Fields[1]; var objY = ds.Summaries[1]; // Khởi tạo đối tượng 'WidgetChart' với bộ dữ liệu. var ret = new WidgetChart(); //ret.RotatedXY = true; ret.SelectCommand = ds.ToSql(); ret.XTitle = objX.ColAliasVI; ret.YTitle = objY.FieldAlias; ret.AddXField(objX.ColName); ret.AddXField(objX1.ColName); ret.AddYField(objY.FieldAlias); return ret; }
private void CreateChart() { var chart = new WidgetChart(); chart.labels = table.Select(x => x[TableColumns[0]].ToString()).ToArray(); foreach (var item in this.Headers) { chart.datasets.Add(new WidgetChart.ChartSeries() { id = item.id, label = item.Text, data = table.Select(x => x[item.id]).ToArray() }); } this.Chart = chart; }