Common\Formulas\FormulaHelpers.cs (277)
122internal static IList<DataField> GetDataFields(SeriesChartType chartType)
127return new DataField[] {
128DataField.LowerWisker, DataField.UpperWisker,
129DataField.LowerBox, DataField.UpperBox,
130DataField.Average, DataField.Median };
132return new DataField[] {
133DataField.Bubble, DataField.BubbleSize };
136return new DataField[] {
137DataField.High, DataField.Low,
138DataField.Open, DataField.Close };
140return new DataField[] {
141DataField.Center,
142DataField.LowerError, DataField.UpperError};
147return new DataField[] {
148DataField.Top, DataField.Bottom };
150return new DataField[] { DataField.Y };
159internal static SeriesChartType GetDefaultChartType(DataField field)
164case DataField.Y:
166case DataField.LowerWisker:
167case DataField.UpperWisker:
168case DataField.LowerBox:
169case DataField.UpperBox:
170case DataField.Average:
171case DataField.Median:
173case DataField.Bubble:
174case DataField.BubbleSize:
176case DataField.High:
177case DataField.Low:
178case DataField.Open:
179case DataField.Close:
181case DataField.Center:
182case DataField.LowerError:
183case DataField.UpperError:
185case DataField.Top:
186case DataField.Bottom:
198internal static DataField? MapFormulaDataField(SeriesChartType chartType, DataField formulaField)
202case DataField.Top:
203case DataField.High:
207case SeriesChartType.BoxPlot: return DataField.UpperBox;
209case SeriesChartType.Stock: return DataField.High;
210case SeriesChartType.ErrorBar: return DataField.UpperError;
214case SeriesChartType.SplineRange: return DataField.Top;
217case DataField.Bottom:
218case DataField.Low:
222case SeriesChartType.BoxPlot: return DataField.LowerBox;
224case SeriesChartType.Stock: return DataField.Low;
225case SeriesChartType.ErrorBar: return DataField.LowerError;
229case SeriesChartType.SplineRange: return DataField.Bottom;
232case DataField.Open:
236case SeriesChartType.BoxPlot: return DataField.Average;
238case SeriesChartType.Stock: return DataField.Open;
239case SeriesChartType.ErrorBar: return DataField.Center;
243case SeriesChartType.SplineRange: return DataField.Bottom;
246case DataField.Close:
247case DataField.Y:
250default: return DataField.Y;
251case SeriesChartType.BoxPlot: return DataField.Average;
252case SeriesChartType.Bubble: return DataField.Bubble;
254case SeriesChartType.Stock: return DataField.Close;
255case SeriesChartType.ErrorBar: return DataField.Center;
259case SeriesChartType.SplineRange: return DataField.Top;
278DataField[] _inputFields;
279DataField[] _outputFields;
288public DataField[] InputFields
297public DataField[] OutputFields
319public FormulaInfo(DataField[] inputFields, DataField[] outputFields, params object[] defaultParams)
438new DataField[] { DataField.Y }, //Input fields
439new DataField[] { DataField.Y }, //Output fields
465new DataField[] { DataField.Y }, //Input fields
466new DataField[] { DataField.Y }, //Output fields
492new DataField[] { DataField.Y }, //Input fields
493new DataField[] { DataField.Y }, //Output fields
519new DataField[] { DataField.Y }, //Input fields
520new DataField[] { DataField.Y }, //Output fields
545new DataField[] { DataField.Y }, //Input fields
546new DataField[] { DataField.Y }, //Output fields
573new DataField[] { DataField.Y }, //Input fields
574new DataField[] { DataField.Top, DataField.Bottom }, //Output fields
591new DataField[] { DataField.Close, DataField.High, DataField.Low }, //Input fields
592new DataField[] { DataField.Y }) //Output fields
608new DataField[] { DataField.Close, DataField.High, DataField.Low }, //Input fields
609new DataField[] { DataField.Y }) //Output fields
625new DataField[] { DataField.High, DataField.Low }, //Input fields
626new DataField[] { DataField.Y }) //Output fields
653new DataField[] { DataField.Y }, //Input fields
654new DataField[] { DataField.Top, DataField.Bottom }, //Output fields
681new DataField[] { DataField.Y }, //Input fields
682new DataField[] { DataField.Y }, //Output fields
709new DataField[] { DataField.High, DataField.Low, DataField.Close, DataField.Y }, //Input fields
710new DataField[] { DataField.Y }, //Output fields
736new DataField[] { DataField.Y }, //Input fields
737new DataField[] { DataField.Y }, //Output fields
764new DataField[] { DataField.High, DataField.Low }, //Input fields
765new DataField[] { DataField.Y }, //Output fields
792new DataField[] { DataField.Y }, //Input fields
793new DataField[] { DataField.Y }, //Output fields
819new DataField[] { DataField.High, DataField.Low, DataField.Close }, //Input fields
820new DataField[] { DataField.Y, DataField.Y }, //Output fields
845new DataField[] { DataField.High, DataField.Low, DataField.Close }, //Input fields
846new DataField[] { DataField.Y }, //Output fields
871new DataField[] { DataField.High, DataField.Low, DataField.Close }, //Input fields
872new DataField[] { DataField.Y }, //Output fields
889new DataField[] { DataField.High, DataField.Low, DataField.Close }, //Input fields
890new DataField[] { DataField.Y }) //Output fields
915new DataField[] { DataField.High, DataField.Low }, //Input fields
916new DataField[] { DataField.Y }, //Output fields
933new DataField[] { DataField.Close }, //Input fields
934new DataField[] { DataField.Y }) //Output fields
958new DataField[] { DataField.Close }, //Input fields
959new DataField[] { DataField.Y }, //Output fields
984new DataField[] { DataField.Close }, //Input fields
985new DataField[] { DataField.Y }, //Output fields
1011new DataField[] { DataField.Close }, //Input fields
1012new DataField[] { DataField.Y }, //Output fields
1037new DataField[] { DataField.High, DataField.Low, DataField.Close }, //Input fields
1038new DataField[] { DataField.Y }, //Output fields
1070new DataField[] { DataField.Close }, //Input fields
1071new DataField[] { DataField.Close, DataField.High, DataField.Low }, //Output fields
1147new DataField[] { DataField.High, DataField.Low, DataField.Close, DataField.Y }, //Input fields: High,Low,Close,Volume
1148new DataField[] { DataField.Y }, //Output fields
1165new DataField[] { DataField.Close, DataField.Y }, //Input=Close,Volume
1166new DataField[] { DataField.Y }) //Output fields
1182new DataField[] { DataField.Close, DataField.Y }, //Input=Close,Volume
1183new DataField[] { DataField.Y }) //Output fields
1207new DataField[] { DataField.Close, DataField.Y }, //Input=Close,Volume
1208new DataField[] { DataField.Y },
1233new DataField[] { DataField.Close, DataField.Y }, //Input=Close,Volume
1234new DataField[] { DataField.Y },
1251new DataField[] { DataField.High, DataField.Low, DataField.Close, DataField.Y }, //Input=High, Low, Close, Volume
1252new DataField[] { DataField.Y }) //Output fields
1296private DataField _dataField;
1320public DataField DataField
1332public SeriesFieldInfo(Series series, DataField dataField)
1342public SeriesFieldInfo(string seriesName, DataField dataField)
1377IList<DataField> dataFields = FormulaHelper.GetDataFields(seriesChartType);
1396public static SeriesFieldList FromString(Chart chart, string seriesFields, IList<DataField> formulaFields)
1404List<DataField> unmappedFormulaFields = new List<DataField>(formulaFields);
1457private static void AddSeriesFieldInfo(SeriesFieldList result, Series series, IList<DataField> unmappedFormulaFields)
1459List<DataField> seriesFields = new List<DataField>(FormulaHelper.GetDataFields(series.ChartType));
1463DataField formulaField = unmappedFormulaFields[i];
1464DataField? seriesField = null;
1480result.Add(new SeriesFieldInfo(series, (DataField)seriesField));
1481seriesFields.Remove((DataField)formulaField);
1497private static void AddSeriesFieldInfo(SeriesFieldList result, Series series, IList<DataField> unmappedFormulaFields, string seriesFieldId)
1499IList<DataField> seriesFields = FormulaHelper.GetDataFields(series.ChartType);
1501DataField? seriesField = null;
1523seriesField = (DataField)Enum.Parse(typeof(DataField), seriesFieldId, true);
1529result.Add(new SeriesFieldInfo(series, (DataField)seriesField));
1530if (unmappedFormulaFields.Contains((DataField)seriesField))
1531unmappedFormulaFields.Remove((DataField)seriesField);
1548private static void AddSeriesFieldInfo(SeriesFieldList result, string seriesName, IList<DataField> unmappedFormulaFields)
1551List<DataField> seriesFields = new List<DataField>(FormulaHelper.GetDataFields(chartType));
1555DataField formulaField = unmappedFormulaFields[i];
1556DataField? seriesField = null;
1567result.Add(new SeriesFieldInfo(seriesName, (DataField)seriesField));
1568seriesFields.Remove((DataField)formulaField);
1584private static void AddSeriesFieldInfo(SeriesFieldList result, string seriesName, IList<DataField> unmappedFormulaFields, string seriesFieldId)
1587IList<DataField> seriesFields = FormulaHelper.GetDataFields(chartType);
1590DataField? seriesField = null;
1616seriesField = (DataField)Enum.Parse(typeof(DataField), seriesFieldId, true);
1624result.Add(new SeriesFieldInfo(seriesName, (DataField)seriesField));
1625unmappedFormulaFields.Remove((DataField)seriesField);