/// <summary> /// Sets the value for the specified column and row. /// </summary> /// <param name="columnIndex">the index of the column</param> /// <param name="rowIndex">the index of the row</param> /// <param name="amount"> the new value</param> public void SetValue(int columnIndex, int rowIndex, double amount) { ChartDataColumn column = mColumns[columnIndex]; ChartDataRow row = mRows[rowIndex]; InnerSetValue(column, row, amount); }
/// <summary> /// removes a group from the radar chart /// </summary> /// <param name="name">the name of the group to remove</param> public void RemoveGroup(string name) { ChartDataRow row = mDataSource.Rows[name]; RemoveSliderForGroup(name); mDataSource.Rows.Remove(row); }
/// <summary> /// Sets the value for the specified column and row /// </summary> /// <param name="ColumnName">the name of the column</param> /// <param name="RowName"> the name of the row</param> /// <param name="amount"> the new value</param> public void SetValue(string ColumnName, string RowName, double amount) { ChartDataColumn column = mColumns[ColumnName]; ChartDataRow row = mRows[RowName]; InnerSetValue(column, row, amount); }
/// <summary> /// Sets the value for the specified column and row. /// </summary> /// <param name="ColumnName">the name of the column</param> /// <param name="rowIndex">the index of the row</param> /// <param name="amount"> the new value</param> public void SetValue(String ColumnName, int rowIndex, double amount) { ChartDataColumn column = mColumns[ColumnName]; ChartDataRow row = mRows[rowIndex]; InnerSetValue(column, row, amount); }
/// <summary> /// Get the value currently for the specified column and row /// </summary> /// <param name="ColumnName">the name of the column</param> /// <param name="rowIndex"> the index of the row</param> /// <returns></returns> public double GetValue(String ColumnName, int rowIndex) { ChartDataColumn column = mColumns[ColumnName]; ChartDataRow row = mRows[rowIndex]; return(InnerGetValue(column, row)); }
/// <summary> /// Get the value currently for the specified column and row /// </summary> /// <param name="columnIndex">the index of the column</param> /// <param name="rowIndex"> the index of the row</param> /// <returns></returns> public double GetValue(int columnIndex, int rowIndex) { ChartDataColumn column = mColumns[columnIndex]; ChartDataRow row = mRows[rowIndex]; return(InnerGetValue(column, row)); }
private void InnerSetValue(ChartDataColumn column, ChartDataRow row, double amount) { EnsureRawData(); int columnIndex, rowIndex; if (mChartDataToIndex.TryGetValue(column, out columnIndex) == false) { throw new ChartException("value cannot be set"); // should never happen } if (mChartDataToIndex.TryGetValue(row, out rowIndex) == false) { throw new ChartException("value cannot be set"); // should never happen } mRawData[rowIndex, columnIndex] = amount; KeyElement elem = new KeyElement(row, column); double oldValue; if (mData.TryGetValue(elem, out oldValue) == false) { oldValue = 0.0; } mData[elem] = amount; bool minMaxChanged = VerifyMinMaxValue(elem, amount); if (mSuspendEvents == false) { OnDataValueChanged(new DataValueChangedEventArgs(rowIndex, columnIndex, 0.0, amount, minMaxChanged)); } else { mFireEvent = true; } }
/// <summary> /// Get the value currently for the specified column and row /// </summary> /// <param name="ColumnName">the name of the column</param> /// <param name="RowName"> the name of the row</param> /// <returns></returns> public double GetValue(String ColumnName, String RowName) { ChartDataColumn column = mColumns[ColumnName]; ChartDataRow row = mRows[RowName]; return(InnerGetValue(column, row)); }
/// <summary> /// Raw data is prepared and held as long as the structed or order of the table has not changed /// </summary> private void PrepareRawData() { mChartDataToIndex.Clear(); for (int i = 0; i < mColumns.Count; i++) { ChartDataColumn column = mColumns[i]; mChartDataToIndex.Add(column, i); } for (int i = 0; i < mRows.Count; i++) { ChartDataRow row = mRows[i]; mChartDataToIndex.Add(row, i); } mRawData = new double[mRows.Count, mColumns.Count]; foreach (KeyValuePair <KeyElement, double> pair in mData) { int columnIndex; int rowIndex; if (mChartDataToIndex.TryGetValue(pair.Key.Column, out columnIndex) == false) { continue; } if (mChartDataToIndex.TryGetValue(pair.Key.Row, out rowIndex) == false) { continue; } mRawData[rowIndex, columnIndex] = pair.Value; } FindMinMaxValue(); }
private double InnerGetValue(ChartDataColumn column, ChartDataRow row) { KeyElement elem = new KeyElement(row, column); double res; if (mData.TryGetValue(elem, out res) == false) { return(0.0); } return(res); }
public bool IsInRow(ChartDataRow row) { return(row == Row); }
void Rows_ItemRemoved(ChartDataRow obj) { ItemRemoved(obj); }
public KeyElement(ChartDataRow row, ChartDataColumn column) : this() { Row = row; Column = column; }