private void btn_connect_Click(object sender, EventArgs e) { if (ControlUINullNameOrChartType() == true) { MessageBox.Show("Lütfen kullanacağınız tüm verilere isim veriniz ve grafik türünü belirtiniz!"); return; } ChartTypeEnum[] chart1TypeEnum = new ChartTypeEnum[10]; string[] chartName = new string[10]; Color[] dataColor = new Color[10]; char splitString = Convert.ToChar(cB_splitChar.Text); int dataCount = Convert.ToInt32(cB_dataCount.Items[cB_dataCount.SelectedIndex]); chart1TypeEnum[0] = Chart_Cb_to_enum(cB_firstG1.SelectedIndex); chart1TypeEnum[1] = Chart_Cb_to_enum(cB_secondG1.SelectedIndex); chart1TypeEnum[2] = Chart_Cb_to_enum(cB_thirdG1.SelectedIndex); chart1TypeEnum[3] = Chart_Cb_to_enum(cB_fourthG1.SelectedIndex); chart1TypeEnum[4] = Chart_Cb_to_enum(cB_fifthG1.SelectedIndex); chart1TypeEnum[5] = Chart_Cb_to_enum(cB_sixthG1.SelectedIndex); chart1TypeEnum[6] = Chart_Cb_to_enum(cB_seventhG1.SelectedIndex); chart1TypeEnum[7] = Chart_Cb_to_enum(cB_eighthG1.SelectedIndex); chart1TypeEnum[8] = Chart_Cb_to_enum(cB_ninthG1.SelectedIndex); chart1TypeEnum[9] = Chart_Cb_to_enum(cB_tenthG1.SelectedIndex); chartName[0] = tB_firstDataName.Text; chartName[1] = tB_secondDataName.Text; chartName[2] = tB_thirdDataName.Text; chartName[3] = tB_fourthDataName.Text; chartName[4] = tB_fifthDataName.Text; chartName[5] = tB_sixthDataName.Text; chartName[6] = tB_seventhDataName.Text; chartName[7] = tB_eighthDataName.Text; chartName[8] = tB_ninthDataName.Text; chartName[9] = tB_tenthDataName.Text; if (ControlSameString(chartName, dataCount - 1) == true) { MessageBox.Show("Lütfen kullanacağınız tüm verilere farklı isim veriniz!"); return; } dataColor[0] = btn_clr1.BackColor; dataColor[1] = btn_clr2.BackColor; dataColor[2] = btn_clr3.BackColor; dataColor[3] = btn_clr4.BackColor; dataColor[4] = btn_clr5.BackColor; dataColor[5] = btn_clr6.BackColor; dataColor[6] = btn_clr7.BackColor; dataColor[7] = btn_clr8.BackColor; dataColor[8] = btn_clr9.BackColor; dataColor[9] = btn_clr10.BackColor; SerialReadAndWrite2 Chart1 = new SerialReadAndWrite2(PortName, Baundrate, splitString, dataCount, chartName, chart1TypeEnum, dataColor, "Chart1"); Chart1.Show(); this.Hide(); }
/// <summary> /// Constructor for deserializing objects /// </summary> /// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data /// </param> /// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data /// </param> /// protected DrawChart(SerializationInfo info, StreamingContext context) { _mchartType = (ChartTypeEnum)info.GetValue("chartType", typeof(ChartTypeEnum)); _misColorMap = info.GetBoolean("isColorMap"); _misHiddenLine = info.GetBoolean("isHiddenLine"); _misInterp = info.GetBoolean("isInterp"); _mnumberInterp = info.GetInt32("numberInterp"); _mnumberContours = info.GetInt32("numberContours"); }
public Chart(CommodityInformation comodityInfo, ChartTypeEnum chartType, ChartTimeFrameEnum chartTimeFrame, IMarketData marketData) { Name = Guid.NewGuid().ToString(); ChartType = chartType; TimeFrame = chartTimeFrame; this.comodityInfo = comodityInfo; ChartData = new DataFrame <double>(); dataReceived = new DataSeries <OHLC>(); indicators = new List <Indicator>(); }
/// <summary> /// Deserialization constructor. /// </summary> public TradeChartSeries(SerializationInfo info, StreamingContext context) : base(info, context) { _chartType = (ChartTypeEnum)info.GetInt32("chartType"); _risingBarFill = (SolidBrush)info.GetValue("risingBarFill", typeof(SolidBrush)); _fallingBarFill = (SolidBrush)info.GetValue("fallingBarFill", typeof(SolidBrush)); _risingBarPen = (Pen)info.GetValue("risingBarPen", typeof(Pen)); _fallingBarPen = (Pen)info.GetValue("fallingBarPen", typeof(Pen)); _timeGapsLinePen = (Pen)info.GetValue("timeGapsLinePen", typeof(Pen)); _showVolume = info.GetBoolean("showVolume"); _volumePen = (Pen)info.GetValue("volumePen", typeof(Pen)); _volumeBrush = (SolidBrush)info.GetValue("volumeBrush", typeof(SolidBrush)); }
public ChartPanelMain(SizeGlobal _sizePanel, ChartTypeEnum _chartTypeEnum) { sizePanel = _sizePanel; sizeAllPoint = new Size(width, height); colorElemChart = new ColorElementsChart(brushAll, brushLast); InitializationCollection(); CheckNunableCollection(); DefaultMinMaxSet(); dispatcher = Dispatcher.CurrentDispatcher; SetTypeChart(_chartTypeEnum); }
public Chart AddChart(string symbol, ChartTypeEnum chartType, ChartTimeFrameEnum timeFrame, string name) { var comodityInfo = Market.GetCommodityInformation(symbol); var chart = new Chart(comodityInfo, chartType, timeFrame, Market, name); if (!Charts.ContainsKey(symbol)) { Charts.Add(symbol, new List <Chart>()); lastDataTimes.Add(symbol, DataStartTime); } Charts[symbol].Add(chart); return(chart); }
//---------------------------------- // установка методов для рисования графика определенного в конструкторе типа private void SetTypeChart(ChartTypeEnum _chartTypeEnum) { switch (_chartTypeEnum) { case ChartTypeEnum.Point: DrawChartAction = ChartPointType; break; case ChartTypeEnum.Gistogramm: DrawChartAction = ChartGistogrammType; break; default: break; } }
/// <summary> /// Initializes a new instance of the <see cref="DashboardItem" /> class. /// </summary> /// <param name="VariableName">The name of the FastStats variable to use to calculate this dashboard item (required).</param> /// <param name="Size">The size of the dashboard item within this composition (required).</param> /// <param name="ChartType">The type of chart to use to display this dashboard item (required).</param> /// <param name="Description">The description to use for this item (required).</param> public DashboardItem(string VariableName = default(string), Size Size = default(Size), ChartTypeEnum ChartType = default(ChartTypeEnum), string Description = default(string)) { // to ensure "VariableName" is required (not null) if (VariableName == null) { throw new InvalidDataException("VariableName is a required property for DashboardItem and cannot be null"); } else { this.VariableName = VariableName; } // to ensure "Size" is required (not null) if (Size == null) { throw new InvalidDataException("Size is a required property for DashboardItem and cannot be null"); } else { this.Size = Size; } // to ensure "ChartType" is required (not null) if (ChartType == null) { throw new InvalidDataException("ChartType is a required property for DashboardItem and cannot be null"); } else { this.ChartType = ChartType; } // to ensure "Description" is required (not null) if (Description == null) { throw new InvalidDataException("Description is a required property for DashboardItem and cannot be null"); } else { this.Description = Description; } }
// public ChartPanelMain(List <MultiDependetPanelTrades> _fullyDependentPanelList, List <PartiallyDependentPanel> _partiallyDependentPanel, SizeGlobal _sizePanel, ChartTypeEnum _chartTypeEnum) { sizePanel = _sizePanel; FullyDependentPanelList = _fullyDependentPanelList; PartiallyDependentPanelList = _partiallyDependentPanel; sizeAllPoint = new Size(width, height); colorElemChart = new ColorElementsChart(brushAll, brushLast); InitializationCollection(); CheckNunableCollection(); DefaultMinMaxSet(); dispatcher = Dispatcher.CurrentDispatcher; SetTypeChart(_chartTypeEnum); }
Matrix _ChartMatrix; // Pseudo matrix to calculate chart data internal Chart(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode) { _Type = ChartTypeEnum.Column; _Subtype = ChartSubTypeEnum.Plain; _SeriesGroupings = null; _CategoryGroupings = null; _ChartData = null; _Legend = null; _CategoryAxis = null; _ValueAxis = null; _Title = null; _PointWidth = 0; _Palette = ChartPaletteEnum.Default; _ThreeDProperties = null; _PlotArea = null; _ChartElementOutput = ChartElementOutputEnum.Output; // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "Type": _Type = ChartType.GetStyle(xNodeLoop.InnerText); if (_Type == ChartTypeEnum.Stock || _Type == ChartTypeEnum.Unknown) { OwnerReport.rl.LogError(8, "Chart type '" + xNodeLoop.InnerText + "' is not currently supported."); } break; case "Subtype": _Subtype = ChartSubType.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "SeriesGroupings": _SeriesGroupings = new SeriesGroupings(r, this, xNodeLoop); break; case "CategoryGroupings": _CategoryGroupings = new CategoryGroupings(r, this, xNodeLoop); break; case "ChartData": _ChartData = new ChartData(r, this, xNodeLoop); break; case "Legend": _Legend = new Legend(r, this, xNodeLoop); break; case "CategoryAxis": _CategoryAxis = new CategoryAxis(r, this, xNodeLoop); break; case "ValueAxis": _ValueAxis = new ValueAxis(r, this, xNodeLoop); break; case "Title": _Title = new Title(r, this, xNodeLoop); break; case "PointWidth": _PointWidth = XmlUtil.Integer(xNodeLoop.InnerText); break; case "Palette": _Palette = ChartPalette.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "ThreeDProperties": _ThreeDProperties = new ThreeDProperties(r, this, xNodeLoop); break; case "PlotArea": _PlotArea = new PlotArea(r, this, xNodeLoop); break; case "ChartElementOutput": _ChartElementOutput = fyiReporting.RDL.ChartElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; default: if (DataRegionElement(xNodeLoop)) // try at DataRegion level { break; } // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Chart element '" + xNodeLoop.Name + "' ignored."); break; } } DataRegionFinish(); // Tidy up the DataRegion if (_SeriesGroupings == null && _CategoryGroupings == null) { OwnerReport.rl.LogError(8, "Chart requires either the SeriesGroupings element or CategoryGroupings element or both."); } if (OwnerReport.rl.MaxSeverity > 4) // if we already have severe error don't check for these additional issues { return; } // Do some specific checking based on the type of the Chart specified switch (_Type) { case ChartTypeEnum.Bubble: if (_ChartData == null || _ChartData.Items[0].Datapoints.Items[0].DataValues.Items.Count != 3) { OwnerReport.rl.LogError(8, "Bubble charts require three DataPoints defined."); } break; case ChartTypeEnum.Scatter: if (_ChartData == null || _ChartData.Items[0].Datapoints.Items[0].DataValues.Items.Count != 2) { OwnerReport.rl.LogError(8, "Scatter charts require two DataPoints defined."); } break; default: break; } }
public SimpleChartSeries(string name, ChartTypeEnum chartType, float[] values) : base(name) { _chartType = chartType; AddValueSet(values); }
public void SetChartType(ChartTypeEnum type) { _chartType = type; }
public LinesChartSeries(string name, ChartTypeEnum chartType, float[] values) : base(name) { _chartType = chartType; AddValueSet(values); }
public Chart(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode) { _Type = ChartTypeEnum.Column; _Subtype = new Expression(r, p, "Plain", ExpressionType.Enum); //AJM GJL 14082008 Allowing Expression _SeriesGroupings = null; _CategoryGroupings = null; _ChartData = null; _Legend = null; _CategoryAxis = null; _ValueAxis = null; _Title = null; _PointWidth = 0; _Palette = new Expression(r, p, "Default", ExpressionType.Enum); //AJM GJL 14082008 Allowing Expression _ThreeDProperties = null; _PlotArea = null; _ChartElementOutput = ChartElementOutputEnum.Output; _isHYNEsWonderfulVector = new Expression(r, p, "False", ExpressionType.Boolean); _showTooltips = new Expression(r, p, "False", ExpressionType.Boolean); _showTooltipsX = new Expression(r, p, "False", ExpressionType.Boolean); _ToolTipXFormat = new Expression(r, p, "", ExpressionType.String); _ToolTipYFormat = new Expression(r, p, "", ExpressionType.String); // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "Type": _Type = ChartType.GetStyle(xNodeLoop.InnerText); if (_Type == ChartTypeEnum.Stock || _Type == ChartTypeEnum.Unknown) { OwnerReport.rl.LogError(8, "Chart type '" + xNodeLoop.InnerText + "' is not currently supported."); } break; case "Subtype": _Subtype = new Expression(r, p, xNodeLoop, ExpressionType.Enum); //AJM GJL 14082008 break; case "SeriesGroupings": _SeriesGroupings = new SeriesGroupings(r, this, xNodeLoop); break; case "CategoryGroupings": _CategoryGroupings = new CategoryGroupings(r, this, xNodeLoop); break; case "ChartData": _ChartData = new ChartData(r, this, xNodeLoop); break; case "Legend": _Legend = new Legend(r, this, xNodeLoop); break; case "CategoryAxis": _CategoryAxis = new CategoryAxis(r, this, xNodeLoop); break; case "ValueAxis": _ValueAxis = new ValueAxis(r, this, xNodeLoop); break; case "Title": _Title = new Title(r, this, xNodeLoop); break; case "PointWidth": _PointWidth = XmlUtil.Integer(xNodeLoop.InnerText); break; case "Palette": _Palette = new Expression(r, p, xNodeLoop, ExpressionType.Enum); //AJM GJL 14082008 break; case "ThreeDProperties": _ThreeDProperties = new ThreeDProperties(r, this, xNodeLoop); break; case "PlotArea": _PlotArea = new PlotArea(r, this, xNodeLoop); break; case "ChartElementOutput": _ChartElementOutput = Oranikle.Report.Engine.ChartElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "HyneWonderfulVector": //AJM GJL 14082008 case "RenderAsVector": case "fyi:RenderAsVector": _isHYNEsWonderfulVector = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; case "fyi:tooltip": case "fyi:Tooltip": _showTooltips = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; case "fyi:TooltipX": _showTooltipsX = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; case "fyi:TooltipYFormat": _ToolTipYFormat = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; case "fyi:TooltipXFormat": _ToolTipXFormat = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; default: if (DataRegionElement(xNodeLoop)) // try at DataRegion level { break; } // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Chart element '" + xNodeLoop.Name + "' ignored."); break; } } DataRegionFinish(); // Tidy up the DataRegion if (_SeriesGroupings == null && _CategoryGroupings == null) { OwnerReport.rl.LogError(8, "Chart requires either the SeriesGroupings element or CategoryGroupings element or both."); } if (OwnerReport.rl.MaxSeverity > 4) // if we already have severe error don't check for these additional issues { return; } // Do some specific checking based on the type of the Chart specified switch (_Type) { case ChartTypeEnum.Bubble: if (_ChartData == null || _ChartData.Items[0].Datapoints.Items[0].DataValues.Items.Count != 3) { OwnerReport.rl.LogError(8, "Bubble charts require three DataPoints defined."); } break; case ChartTypeEnum.Scatter: if (_ChartData == null || _ChartData.Items[0].Datapoints.Items[0].DataValues.Items.Count != 2) { OwnerReport.rl.LogError(8, "Scatter charts require two DataPoints defined."); } break; default: break; } }
private static ChartDataType[] GetViewData(IEnumerable <ChartDataType> datas, ViewTypeEnum viewType, ChartTypeEnum chartType, FilterTypeEnum filterType) { switch (chartType) { case ChartTypeEnum.HistogramChart: case ChartTypeEnum.ColumnarChart: case ChartTypeEnum.LineChart: return(GetChartedData(datas, viewType, filterType != FilterTypeEnum.ProductOrBarcode)); case ChartTypeEnum.ThreeDimensionalChart: return(filterType == FilterTypeEnum.ProductOrBarcode ? GetChartedData(datas, viewType, false, true) : GetChartedData(datas, viewType, true)); default: return(datas.OrderBy(d => d.DateTime).ToArray()); } }
public static ChartDataType[] GetChartData(StatSalesType[] modelData, StatTypeEnum statType, ViewTypeEnum viewType, ChartTypeEnum chartType, FilterTypeEnum filterType, bool isCount, bool isUseCodeInName) { switch (statType) { case StatTypeEnum.StatSales: return(GetViewData(modelData.Select(row => new ChartDataType { DateTime = row.Date, DateName = row.Date.ToString(), Name = isUseCodeInName ? string.Format("{0} ({1})", row.Name, row.Number) : row.FullName, CodeBar = isCount ? row.Qty.ToString() : string.Format("{0} €", GetTotal(row)), Price = GetTotal(row), Count = isCount ? row.Qty : GetTotal(row) }), viewType, chartType, filterType)); case StatTypeEnum.StatSalesWithReceipts: return(GetViewData(modelData.Select(row => new ChartDataType { DateTime = row.Date, DateName = row.Date.ToString(), Name = isUseCodeInName ? string.Format("{0} ({1})", row.Name, row.Number) : row.FullName, CodeBar = isCount ? row.Qty.ToString() : string.Format("{0} €", GetPrix(row)), Price = GetPrix(row), Count = isCount ? row.Qty : GetPrix(row) }), viewType, chartType, filterType)); } return(null); }
Matrix _ChartMatrix; // Pseudo matrix to calculate chart data internal Chart(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p, xNode) { _Type = ChartTypeEnum.Column; _Subtype = ChartSubTypeEnum.Plain; _SeriesGroupings = null; _CategoryGroupings = null; _ChartData = null; _Legend = null; _CategoryAxis = null; _ValueAxis = null; _Title = null; _PointWidth = 0; _Palette = ChartPaletteEnum.Default; _ThreeDProperties = null; _PlotArea = null; _ChartElementOutput = ChartElementOutputEnum.Output; // Loop thru all the child nodes foreach (XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) { continue; } switch (xNodeLoop.Name) { case "Type": _Type = ChartType.GetStyle(xNodeLoop.InnerText); if (_Type == ChartTypeEnum.Scatter || _Type == ChartTypeEnum.Bubble || _Type == ChartTypeEnum.Stock || _Type == ChartTypeEnum.Unknown) { OwnerReport.rl.LogError(8, "Chart type '" + xNodeLoop.InnerText + "' is not currently supported."); } break; case "Subtype": _Subtype = ChartSubType.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "SeriesGroupings": _SeriesGroupings = new SeriesGroupings(r, this, xNodeLoop); break; case "CategoryGroupings": _CategoryGroupings = new CategoryGroupings(r, this, xNodeLoop); break; case "ChartData": _ChartData = new ChartData(r, this, xNodeLoop); break; case "Legend": _Legend = new Legend(r, this, xNodeLoop); break; case "CategoryAxis": _CategoryAxis = new CategoryAxis(r, this, xNodeLoop); break; case "ValueAxis": _ValueAxis = new ValueAxis(r, this, xNodeLoop); break; case "Title": _Title = new Title(r, this, xNodeLoop); break; case "PointWidth": _PointWidth = XmlUtil.Integer(xNodeLoop.InnerText); break; case "Palette": _Palette = ChartPalette.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "ThreeDProperties": _ThreeDProperties = new ThreeDProperties(r, this, xNodeLoop); break; case "PlotArea": _PlotArea = new PlotArea(r, this, xNodeLoop); break; case "ChartElementOutput": _ChartElementOutput = fyiReporting.RDL.ChartElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; default: if (DataRegionElement(xNodeLoop)) // try at DataRegion level { break; } // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Chart element '" + xNodeLoop.Name + "' ignored."); break; } } DataRegionFinish(); // Tidy up the DataRegion if (_SeriesGroupings == null && _CategoryGroupings == null) { OwnerReport.rl.LogError(8, "Chart requires either the SeriesGroupings element or CategoryGroupings element or both."); } }
Matrix _ChartMatrix; // Pseudo matrix to calculate chart data internal Chart(ReportDefn r, ReportLink p, XmlNode xNode):base(r, p, xNode) { _Type=ChartTypeEnum.Column; _Subtype=ChartSubTypeEnum.Plain; _SeriesGroupings=null; _CategoryGroupings=null; _ChartData=null; _Legend=null; _CategoryAxis=null; _ValueAxis=null; _Title=null; _PointWidth=0; _Palette=ChartPaletteEnum.Default; _ThreeDProperties=null; _PlotArea=null; _ChartElementOutput=ChartElementOutputEnum.Output; // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Type": _Type = ChartType.GetStyle(xNodeLoop.InnerText); if (_Type == ChartTypeEnum.Scatter || _Type == ChartTypeEnum.Bubble || _Type == ChartTypeEnum.Stock || _Type == ChartTypeEnum.Unknown) { OwnerReport.rl.LogError(8, "Chart type '" + xNodeLoop.InnerText + "' is not currently supported."); } break; case "Subtype": _Subtype = ChartSubType.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "SeriesGroupings": _SeriesGroupings = new SeriesGroupings(r, this, xNodeLoop); break; case "CategoryGroupings": _CategoryGroupings = new CategoryGroupings(r, this, xNodeLoop); break; case "ChartData": _ChartData = new ChartData(r, this, xNodeLoop); break; case "Legend": _Legend = new Legend(r, this, xNodeLoop); break; case "CategoryAxis": _CategoryAxis = new CategoryAxis(r, this, xNodeLoop); break; case "ValueAxis": _ValueAxis = new ValueAxis(r, this, xNodeLoop); break; case "Title": _Title = new Title(r, this, xNodeLoop); break; case "PointWidth": _PointWidth = XmlUtil.Integer(xNodeLoop.InnerText); break; case "Palette": _Palette = ChartPalette.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "ThreeDProperties": _ThreeDProperties = new ThreeDProperties(r, this, xNodeLoop); break; case "PlotArea": _PlotArea = new PlotArea(r, this, xNodeLoop); break; case "ChartElementOutput": _ChartElementOutput = fyiReporting.RDL.ChartElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; default: if (DataRegionElement(xNodeLoop)) // try at DataRegion level break; // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Chart element '" + xNodeLoop.Name + "' ignored."); break; } } DataRegionFinish(); // Tidy up the DataRegion if (_SeriesGroupings == null && _CategoryGroupings == null) OwnerReport.rl.LogError(8, "Chart requires either the SeriesGroupings element or CategoryGroupings element or both."); }
/// <summary> /// 设置xy轴数据 /// </summary> private Chart SetXYs(ChartBasicModel model) { Chart chart = model.chart; ChartTypeEnum chartTypeEnum = model.serie[0].Type; //饼图/圆环/漏斗图/卡吉图/雷达图/砖型图/新三值图 ---单序列、单y值、需要加颜色 if (chartTypeEnum == ChartTypeEnum.Pie || chartTypeEnum == ChartTypeEnum.Doughnut || chartTypeEnum == ChartTypeEnum.Funnel || chartTypeEnum == ChartTypeEnum.Kagi || chartTypeEnum == ChartTypeEnum.Pyramid || chartTypeEnum == ChartTypeEnum.Kagi || chartTypeEnum == ChartTypeEnum.Renko) { chart.Series[0].Points.DataBindXY(model.xAxis.Data, model.serie[0].Data); if (chartTypeEnum != ChartTypeEnum.Radar || chartTypeEnum != ChartTypeEnum.Renko) { DataPointCollection points = chart.Series[0].Points; for (int i = 0; i < points.Count; i++) { points[i].Color = ChartColors.ChartsColor[i]; if (model.xAxis.Data.Count == model.serie[0].Data.Count) { points[i].LegendText = model.xAxis.Data[i].ToString().Trim(); } } } } //气泡图/误差条形图 ---单序列、2个y值 else if (chartTypeEnum == ChartTypeEnum.Bubble || chartTypeEnum == ChartTypeEnum.ErrorBar || chartTypeEnum == ChartTypeEnum.PointAndFigure) { // Arguments: X value, low value, high value chart.Series[0].Points.DataBindXY(model.xAxis.Data, model.serie[0].Data, model.serie[0].Data2); } //范围图 ---多序列、2个y值 else if (chartTypeEnum == ChartTypeEnum.Range || chartTypeEnum == ChartTypeEnum.RangeBar || chartTypeEnum == ChartTypeEnum.RangeColumn || chartTypeEnum == ChartTypeEnum.SplineArea) { for (int i = 0; i < model.serie.Length; i++) { chart.Series[i].Points.DataBindXY(model.xAxis.Data, model.serie[i].Data, model.serie[i].Data2); } } //股价图 --多序列、4个y值 else if (chartTypeEnum == ChartTypeEnum.Stock) { for (int j = 0; j < model.serie.Length; j++) { //最高价,最低价,开盘价和收盘价 chart.Series[j].Points.DataBindXY(model.xAxis.Data, model.serie[j].Data, model.serie[j].Data2, model.serie[j].Data3, model.serie[j].Data4); DataPointCollection points = chart.Series[0].Points; for (int i = 0; i < points.Count; i++) { points[i].Color = ChartColors.ChartsColor[i]; if (model.xAxis.Data.Count == model.serie[0].Data.Count) { points[i].LegendText = model.xAxis.Data[i].ToString().Trim(); } } } } else if (chartTypeEnum == ChartTypeEnum.Polar) { //x轴为角度,必须是数值 List <double> lst = model.xAxis.Data.Select <string, double>(x => Convert.ToDouble(x)).ToList(); chart.Series[0].Points.DataBindXY(lst, model.serie[0].Data); } else { for (int i = 0; i < model.serie.Length; i++) { chart.Series[i].Points.DataBindXY(model.xAxis.Data, model.serie[i].Data); } } return(chart); }
public bool LoadTableAndChart(StatSalesType[] modelData, StatTypeEnum statType, ChartTypeEnum chartType, ViewTypeEnum viewType, FilterTypeEnum filterType, bool isCount, bool isUseCodeInName) { try { var parameters = new List <ReportParameter> { new ReportParameter("ChartType", chartType.ToString()), new ReportParameter("Symbol", isCount?" ":"€") }; var reportDataSource = new ReportDataSource { Name = "ChartDataSet", Value = ModelToChartDataService.GetChartData(modelData, statType, viewType, chartType, filterType, isCount, isUseCodeInName) }; _report.Reset(); _report.ProcessingMode = ProcessingMode.Local; _report.LocalReport.ReportEmbeddedResource = "ChartStat.ChartUI.Reports.ReportWithTable.rdlc"; _report.LocalReport.SetParameters(parameters); _report.LocalReport.DataSources.Add(reportDataSource); _report.RefreshReport(); return(true); } catch (Exception) { return(false); } }
public override void SetSelectedChartType(string chartType) { _chartType = (ChartTypeEnum)Enum.Parse(typeof(ChartTypeEnum), chartType); }
/// <summary> /// /// </summary> public TradeChartSeries(string name, ChartTypeEnum chartType, BarData[] bars, TimeSpan period) { _chartType = chartType; SetBarData(bars, period); }
public Chart(ReportDefn r, ReportLink p, XmlNode xNode):base(r, p, xNode) { _Type=ChartTypeEnum.Column; _Subtype= new Expression(r,p,"Plain",ExpressionType.Enum); //AJM GJL 14082008 Allowing Expression _SeriesGroupings=null; _CategoryGroupings=null; _ChartData=null; _Legend=null; _CategoryAxis=null; _ValueAxis=null; _Title=null; _PointWidth=0; _Palette = new Expression(r, p, "Default", ExpressionType.Enum); //AJM GJL 14082008 Allowing Expression _ThreeDProperties=null; _PlotArea=null; _ChartElementOutput=ChartElementOutputEnum.Output; _isHYNEsWonderfulVector = new Expression(r, p, "False", ExpressionType.Boolean); _showTooltips = new Expression(r,p,"False",ExpressionType.Boolean); _showTooltipsX = new Expression(r, p, "False", ExpressionType.Boolean); _ToolTipXFormat = new Expression(r, p, "", ExpressionType.String); _ToolTipYFormat = new Expression(r, p, "", ExpressionType.String); // Loop thru all the child nodes foreach(XmlNode xNodeLoop in xNode.ChildNodes) { if (xNodeLoop.NodeType != XmlNodeType.Element) continue; switch (xNodeLoop.Name) { case "Type": _Type = ChartType.GetStyle(xNodeLoop.InnerText); if (_Type == ChartTypeEnum.Stock || _Type == ChartTypeEnum.Unknown) { OwnerReport.rl.LogError(8, "Chart type '" + xNodeLoop.InnerText + "' is not currently supported."); } break; case "Subtype": _Subtype = new Expression(r, p, xNodeLoop, ExpressionType.Enum); //AJM GJL 14082008 break; case "SeriesGroupings": _SeriesGroupings = new SeriesGroupings(r, this, xNodeLoop); break; case "CategoryGroupings": _CategoryGroupings = new CategoryGroupings(r, this, xNodeLoop); break; case "ChartData": _ChartData = new ChartData(r, this, xNodeLoop); break; case "Legend": _Legend = new Legend(r, this, xNodeLoop); break; case "CategoryAxis": _CategoryAxis = new CategoryAxis(r, this, xNodeLoop); break; case "ValueAxis": _ValueAxis = new ValueAxis(r, this, xNodeLoop); break; case "Title": _Title = new Title(r, this, xNodeLoop); break; case "PointWidth": _PointWidth = XmlUtil.Integer(xNodeLoop.InnerText); break; case "Palette": _Palette = new Expression(r, p, xNodeLoop, ExpressionType.Enum); //AJM GJL 14082008 break; case "ThreeDProperties": _ThreeDProperties = new ThreeDProperties(r, this, xNodeLoop); break; case "PlotArea": _PlotArea = new PlotArea(r, this, xNodeLoop); break; case "ChartElementOutput": _ChartElementOutput = Oranikle.Report.Engine.ChartElementOutput.GetStyle(xNodeLoop.InnerText, OwnerReport.rl); break; case "HyneWonderfulVector": //AJM GJL 14082008 case "RenderAsVector": case "fyi:RenderAsVector": _isHYNEsWonderfulVector = new Expression(r,p,xNodeLoop,ExpressionType.Boolean); break; case "fyi:tooltip": case "fyi:Tooltip": _showTooltips = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; case "fyi:TooltipX": _showTooltipsX = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; case "fyi:TooltipYFormat": _ToolTipYFormat = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; case "fyi:TooltipXFormat": _ToolTipXFormat = new Expression(r, p, xNodeLoop, ExpressionType.Boolean); break; default: if (DataRegionElement(xNodeLoop)) // try at DataRegion level break; // don't know this element - log it OwnerReport.rl.LogError(4, "Unknown Chart element '" + xNodeLoop.Name + "' ignored."); break; } } DataRegionFinish(); // Tidy up the DataRegion if (_SeriesGroupings == null && _CategoryGroupings == null) OwnerReport.rl.LogError(8, "Chart requires either the SeriesGroupings element or CategoryGroupings element or both."); if (OwnerReport.rl.MaxSeverity > 4) // if we already have severe error don't check for these additional issues return; // Do some specific checking based on the type of the Chart specified switch (_Type) { case ChartTypeEnum.Bubble: if (_ChartData == null || _ChartData.Items[0].Datapoints.Items[0].DataValues.Items.Count != 3) OwnerReport.rl.LogError(8, "Bubble charts require three DataPoints defined."); break; case ChartTypeEnum.Scatter: if (_ChartData == null || _ChartData.Items[0].Datapoints.Items[0].DataValues.Items.Count != 2) OwnerReport.rl.LogError(8, "Scatter charts require two DataPoints defined."); break; default: break; } }
private SeriesChartType getSeriesChartType(ChartTypeEnum type) { switch (type) { case ChartTypeEnum.Column: return(SeriesChartType.Column); case ChartTypeEnum.Pie: return(SeriesChartType.Pie); case ChartTypeEnum.Line: return(SeriesChartType.Line); case ChartTypeEnum.Bubble: return(SeriesChartType.Bubble); case ChartTypeEnum.Area: return(SeriesChartType.Area); case ChartTypeEnum.Bar: return(SeriesChartType.Bar); case ChartTypeEnum.BoxPlot: return(SeriesChartType.BoxPlot); case ChartTypeEnum.Candlestick: return(SeriesChartType.Candlestick); case ChartTypeEnum.Doughnut: return(SeriesChartType.Doughnut); case ChartTypeEnum.ErrorBar: return(SeriesChartType.ErrorBar); case ChartTypeEnum.FastLine: return(SeriesChartType.FastLine); case ChartTypeEnum.FastPoint: return(SeriesChartType.FastPoint); case ChartTypeEnum.Funnel: return(SeriesChartType.Funnel); case ChartTypeEnum.Kagi: return(SeriesChartType.Kagi); case ChartTypeEnum.Point: return(SeriesChartType.Point); case ChartTypeEnum.PointAndFigure: return(SeriesChartType.PointAndFigure); case ChartTypeEnum.Polar: return(SeriesChartType.Polar); case ChartTypeEnum.Pyramid: return(SeriesChartType.Pyramid); case ChartTypeEnum.Radar: return(SeriesChartType.Radar); case ChartTypeEnum.Range: return(SeriesChartType.Range); case ChartTypeEnum.RangeBar: return(SeriesChartType.RangeBar); case ChartTypeEnum.RangeColumn: return(SeriesChartType.RangeColumn); case ChartTypeEnum.Renko: return(SeriesChartType.Renko); case ChartTypeEnum.Spline: return(SeriesChartType.Spline); case ChartTypeEnum.SplineArea: return(SeriesChartType.Bubble); case ChartTypeEnum.SplineRange: return(SeriesChartType.SplineRange); case ChartTypeEnum.StackedArea: return(SeriesChartType.StackedArea); case ChartTypeEnum.StackedArea100: return(SeriesChartType.StackedArea100); case ChartTypeEnum.StackedBar: return(SeriesChartType.StackedBar); case ChartTypeEnum.StackedBar100: return(SeriesChartType.StackedBar100); case ChartTypeEnum.StackedColumn: return(SeriesChartType.StackedColumn); case ChartTypeEnum.StackedColumn100: return(SeriesChartType.StackedColumn100); case ChartTypeEnum.StepLine: return(SeriesChartType.StepLine); case ChartTypeEnum.Stock: return(SeriesChartType.Stock); case ChartTypeEnum.ThreeLineBreak: return(SeriesChartType.ThreeLineBreak); default: break; } return(SeriesChartType.Line); }
/// <summary> /// /// </summary> public TradeChartSeries(string name, ChartTypeEnum chartType) : base(name) { _chartType = chartType; }
public Chart(CommodityInformation comodityInfo, ChartTypeEnum chartType, ChartTimeFrameEnum chartTimeFrame, IMarketData marketData, string name) : this(comodityInfo, chartType, chartTimeFrame, marketData) { Name = name; }