Introduction
This article focuses on the visibility of internal supply chain management process. It is a sequel to internal supply chain visibility. In this article, the objective is materialized using MSChart and hence provides assessment apparatus. Solution comprises Bar, Line, Area, Pie, Pareto and Kagi charts. These are further compartmentalized with respect to their respective attributes.
Reports are categories into segregated, cumulative and change in rates reports. Segregated reports provides a context of particular item or goods with this context other sub context resides to analyze that item or material. Cumulative reports provides a context of all items or it slides item context to the side.
Segregated and cumulative reports are further classified to segregated cost, segregated quantity, cumulative cost, cumulative quantity.
Segregated Cost Reports
Segregated cost reports contour cost perspective In Transit, current, In-Process, reserved, consumed and wasted raw material for procurement, and up-coming, current, In-Process, Sales Return, reserved, sold, and wasted finished goods for warehouse.
Material Segregate Cost Reports
Finished Goods Segregate Cost Reports
Segregated Quantity Reports
Segregated quantity reports contours quantity perspective In Transit , current, In-Process, reserved, Consumed and wasted raw material for procurement, and up-coming, current, In-Process, Sales Return, reserved, sold, and wasted finished goods for warehouse.
Material Segregate Quantity Reports
Finished Goods Segregate Quantity Reports
Cumulative Cost Reports
Cumulative cost reports contour cost perspective In Transit , current, In-Process, reserved, consumed and wasted raw material for procurement, and up-coming, current, In-Process, Sales Return, reserved, sold, and wasted finished goods for warehouse.
Material Cumulative Cost Reports
Finished Goods Cumulative Cost Reports
Chart Working
Microsoft Chart constitutes Chart
, ChartArea
and Series
classes. Collaboration of this object makes a chart report. A brief description of it is as under.
Chart Class
Chart
control provides a canvas for a chart report. It acts as a container for chartArea
. Hence, it can be seen as a framework upon which chart will be masked. SetChart()
method is used in solution set attributes of the chart. It assigns title and set legends attributes for the report.
System.Windows.Forms.DataVisualization.Charting.Chart SetChart()
{
System.Windows.Forms.DataVisualization.Charting.Chart chartTemp =
new System.Windows.Forms.DataVisualization.Charting.Chart();
chartTemp.BackColor = System.Drawing.Color.Gainsboro;
chartTemp.BackGradientStyle =
System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom;
chartTemp.BackSecondaryColor = System.Drawing.Color.Silver;
chartTemp.BorderlineColor = System.Drawing.Color.FromArgb
(((int)(((byte)(26)))), ((int)(((byte)(59)))), ((int)(((byte)(105)))));
chartTemp.BorderlineDashStyle =
System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
chartTemp.BorderlineWidth = 3;
chartTemp.BorderSkin.SkinStyle =
System.Windows.Forms.DataVisualization.Charting.BorderSkinStyle.Sunken;
if (_charts == Charts.Pie)
{
chartTemp.ChartAreas.Add(SetPieChartArea());
}
else
{
chartTemp.ChartAreas.Add(SetChartArea());
}
chartTemp.Legends.Add(SetLegend());
chartTemp.Location = new System.Drawing.Point(10, 10);
chartTemp.Name = "chart";
chartTemp.Size = new System.Drawing.Size(1000, 450);
chartTemp.TabIndex = 0;
return chartTemp;
}
ChartArea Class
ChartArea
is a content of a chart class. It is added to chart class as collections. It provides intrinsic visualization of chart report other than data visualization, data visualization is done by Series which will be discuss later. SetChartArea()
method sets attributes of chart area which define the style of report needed to be generated what will be attributes of x-axis and y-axis.
ChartArea SetChartArea()
{
System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 =
new System.Windows.Forms.DataVisualization.Charting.ChartArea();
chartArea1.Area3DStyle.Inclination = 15;
chartArea1.Area3DStyle.IsClustered = true;
chartArea1.Area3DStyle.IsRightAngleAxes = false;
chartArea1.Area3DStyle.LightStyle =
System.Windows.Forms.DataVisualization.Charting.LightStyle.Realistic;
chartArea1.Area3DStyle.Perspective = 7;
chartArea1.Area3DStyle.Rotation = 20;
chartArea1.Area3DStyle.WallWidth = 10;
chartArea1.AxisX.LabelStyle.Font = new System.Drawing.Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
chartArea1.AxisX.LineColor = System.Drawing.Color.Teal;
chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.Teal;
chartArea1.AxisY.LabelStyle.Font = new System.Drawing.Font
("Trebuchet MS", 8.25F, System.Drawing.FontStyle.Bold);
chartArea1.AxisY.LineColor = System.Drawing.Color.FromArgb
(((int)(((byte)(64)))), ((int)(((byte)(64)))),
((int)(((byte)(64)))), ((int)(((byte)(64)))));
chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.Teal;
chartArea1.BackColor = System.Drawing.Color.Gainsboro;
chartArea1.BackGradientStyle =
System.Windows.Forms.DataVisualization.Charting.GradientStyle.TopBottom;
chartArea1.BackSecondaryColor = System.Drawing.Color.Silver;
chartArea1.BorderColor = System.Drawing.Color.Teal;
chartArea1.BorderDashStyle =
System.Windows.Forms.DataVisualization.Charting.ChartDashStyle.Solid;
chartArea1.Name = "Default";
chartArea1.ShadowColor = System.Drawing.Color.Transparent;
return chartArea1;
}
Series Class
Series
class resides in System.Windows.Forms.DataVisualization.Charting
namespace. Series
class object are contents of ChartArea
class. They are added to ChartArea
object as collection. Hence we can have multiple type of charts within the same chartArea
for comparative reports. Series
class object is collection DataPoints
objects. DataPoints
can be collected by series.Points.AddXY(ts.Days, amount)
method. The first parameter of addXY( , )
method defines x-coordinate of a point and y-coordinate is collected from the second parameter. When series type is set as SeriesChartType.Line
, then DataPoints
will act as point which generated line by joining all datapoints
in collections. If it is set as SeriesChartType.Column
, then y-coordinate will be the height of vertical bar and its position on the base is decided by x-coordinate. Same is the case with Kage chart as well.
Pareto Chart
Pareto is an combinational chart. It’s a combination of bar and line chart. Bar chart shows product or material along x –axis and amount or quantity along y-axis. In the same chart conformed a line chart shows cumulative sum of preceding material. InitializeParetoChart()
and ParetoChartTypeLoad()
are fundamental methods for generation of this chart.
#region Pareto Chart
private void InitializeParetoChart()
{
this.chart = SetChart();
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
this.SuspendLayout();
this.chart.ChartAreas[0].AxisX.Interval = 1;
this.chart.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Days;
this.chart.ChartAreas[0].AxisX.IntervalOffset = 1;
this.chart.ChartAreas[0].AxisX.IntervalOffsetType = DateTimeIntervalType.Days;
this.chart.ChartAreas[0].AxisX.LabelAutoFitStyle |=
LabelAutoFitStyles.LabelsAngleStep90;
this.chart.ChartAreas[0].AxisY2.IsLabelAutoFit = false;
this.ReportPanel.Controls.Add(this.chart);
ParetoChartTypeLoad();
((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
this.ResumeLayout(false);
}
void MakeParetoChart(System.Windows.Forms.DataVisualization.Charting.Chart chart,
string srcSeriesName, string destSeriesName)
{
string strChartArea = chart.Series[srcSeriesName].ChartArea;
chart.Series[srcSeriesName].ChartType = SeriesChartType.Column;
chart.DataManipulator.Sort(PointSortOrder.Descending, srcSeriesName);
double total = 0.0;
foreach (DataPoint pt in chart.Series[srcSeriesName].Points)
total += pt.YValues[0];
chart.ChartAreas[strChartArea].AxisY.Maximum = total;
Series destSeries = new Series(destSeriesName);
chart.Series.Add(destSeries);
destSeries.ChartType = SeriesChartType.Line;
destSeries.BorderWidth = 3;
destSeries.ChartArea = chart.Series[srcSeriesName].ChartArea;
destSeries.YAxisType = AxisType.Secondary;
chart.ChartAreas[strChartArea].AxisY2.Maximum = 100;
chart.ChartAreas[strChartArea].AxisY2.LabelStyle.Format = "P00";
chart.ChartAreas[strChartArea].AxisX.LabelStyle.IsEndLabelVisible = false;
double percentage = 0.0;
foreach (DataPoint pt in chart.Series[srcSeriesName].Points)
{
percentage += (pt.YValues[0] / total * 100.0);
destSeries.Points.Add( ( Math.Round(percentage, 2) ) );
}
}
private void ParetoChartTypeLoad()
{
Main.ChartDialog.PlantSegregation pseg =
new ISCMS.Main.ChartDialog.PlantSegregation
(_plantSegment, _charts, _chartBy, _is_Segregation, this);
rows = pseg.Process();
if (rows.Length == 0)
{
ReportPanel.Controls.Clear();
Hasan.CMessageBoxSmall.ShowBox("No record has been found,
to generate Reports", (int)Hasan.CMessageBox.Type.Exclamation,
Location.X, Location.Y);
return;
}
this.chart.Titles.Add(SetTitle());
System.Windows.Forms.DataVisualization.Charting.Series series =
new System.Windows.Forms.DataVisualization.Charting.Series();
series.BorderColor = System.Drawing.Color.FromArgb
(((int)(((byte)(180)))), ((int)(((byte)(26)))),
((int)(((byte)(59)))), ((int)(((byte)(105)))));
series.ChartArea = "Default";
series.Legend = "Default";
series.Name = "Default";
this.chart.Series.Add(series);
chart.Series["Default"].Points.Clear();
int amount = 0;
for (int i = 0; i < rows.Length; i++) {
amount = pseg.ProcessItem(i);
if (amount == 0)
continue;
chart.Series["Default"].Points.AddXY(rows[i]["Name"].ToString(), amount);
}
if (chart.Series.Count > 1)
chart.Series.RemoveAt(1);
MakeParetoChart(chart, "Default", "Pareto");
chart.Series["Pareto"].ChartType = SeriesChartType.Line;
chart.Series["Pareto"].Color = Color.FromArgb(252, 180, 65);
chart.Series["Pareto"].IsValueShownAsLabel = false;
chart.Series["Pareto"].MarkerColor = Color.Red;
chart.Series["Pareto"].MarkerStyle = MarkerStyle.None;
chart.Series["Pareto"].MarkerBorderColor = Color.MidnightBlue;
chart.Series["Pareto"].MarkerSize = 8;
chart.Series["Pareto"].LabelFormat = "0.#"; }
#endregion
Line Chart
This chart is used to represent perpetual inventory with respect to cost and quantity. The main constituents to generate this chart are InitializeLineCurvesChart() and LineCurvesChartTypeLoad().
#region Line Chart
private void InitializeLineCurvesChart()
{
this.chart = SetChart();
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
this.SuspendLayout();
this.ReportPanel.Controls.Add(this.chart);
LineCurvesChartTypeLoad();
((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
this.ResumeLayout(false);
}
private void LineCurvesChartTypeLoad()
{
Main.ChartDialog.PlantSegregation pseg =
new ISCMS.Main.ChartDialog.PlantSegregation
(_plantSegment, _charts, _chartBy, _is_Segregation, this);
rows = pseg.Process();
if (rows.Length == 0)
{
ReportPanel.Controls.Clear();
Hasan.CMessageBoxSmall.ShowBox("No record has been found,
to generate Reports", (int)Hasan.CMessageBox.Type.Exclamation,
Location.X, Location.Y);
return;
}
this.chart.Titles.Add( SetTitle());
System.Windows.Forms.DataVisualization.Charting.Series series =
new System.Windows.Forms.DataVisualization.Charting.Series();
series.BorderColor = System.Drawing.Color.Transparent;
series.BorderWidth = 3;
series.ChartArea = "Default";
series.ChartType =
System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Area;
series.Color = _serial_Color;
series.Legend = "Default";
series.MarkerSize = 4;
series.MarkerStyle =
System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
series.Name = "series";
series.ShadowColor = System.Drawing.Color.Gainsboro;
series.ShadowOffset = 2;
series.XValueType =
System.Windows.Forms.DataVisualization.Charting.ChartValueType.Date;
series.YValueType =
System.Windows.Forms.DataVisualization.Charting.ChartValueType.Double;
series.BorderColor = System.Drawing.Color.Transparent;
TimeSpan ts = DateTime.Now - new DateTime(1900, 1, 1);
double days = ts.Days;
double days2 = days;
int amount = 0;
int perviousAmount = 0;
for (int pointIndex = 0; pointIndex < rows.Length; pointIndex++)
{
amount = pseg.ProcessItem(pointIndex);
ts = DateTime.Parse(rows[pointIndex]["Date"].ToString()) -
new DateTime(1900, 1, 1);
if (perviousAmount == 0 && pointIndex == 0)
{
series.Points.AddXY(ts.Days, amount);
perviousAmount = amount;
continue;
}
if (pointIndex == (rows.Length - 1))
{
series.Points.AddXY(ts.Days, amount);
continue;
}
if( perviousAmount != amount )
{
series.Points.AddXY(ts.Days, amount);
perviousAmount = amount;
continue;
}
}
switch (combChartType.Text)
{
case "Line":
if (!chkAreaChart.Checked)
{
series.ChartType = SeriesChartType.Line;
}
else
{
series.ChartType = SeriesChartType.Area;
}
break;
case "Spline":
if (!chkAreaChart.Checked)
{
series.ChartType = SeriesChartType.Spline;
}
else
{
series.ChartType = SeriesChartType.SplineArea;
}
break;
case "StepLine":
if (!chkAreaChart.Checked)
{
series.ChartType = SeriesChartType.StepLine;
}
else
{
series.ChartType = SeriesChartType.SplineArea;
}
break;
}
if (chkPointLabel.Checked)
{
series.IsValueShownAsLabel = true;
}
else
{
series.IsValueShownAsLabel = false;
}
if (chkMargin.Checked)
chart.ChartAreas["Default"].AxisX.IsMarginVisible = true;
else
chart.ChartAreas["Default"].AxisX.IsMarginVisible = false;
if (chkDisplay3D.Checked)
chart.ChartAreas["Default"].Area3DStyle.Enable3D = true;
else
chart.ChartAreas["Default"].Area3DStyle.Enable3D = false;
this.chart.Series.Add(series);
}
#endregion
Pie Chart
It is a cumulative chart which can be generated by calling the InitializePieCollection()
method. Its code is as given below:
#region Pie Chart
private void InitializePieCollection()
{
this.chart = SetChart();
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
this.SuspendLayout();
this.chart.Legends[0].Enabled = true;
this.chart.Legends[0].IsEquallySpacedItems = true;
this.ReportPanel.Controls.Add(this.chart);
PieChartTypeLoad();
((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
this.ResumeLayout(false);
}
private void PieChartTypeLoad()
{
Main.ChartDialog.PlantSegregation pseg =
new ISCMS.Main.ChartDialog.PlantSegregation
(_plantSegment, _charts, _chartBy, _is_Segregation, this);
rows = pseg.Process();
if (rows.Length == 0)
{
ReportPanel.Controls.Clear();
Hasan.CMessageBoxSmall.ShowBox("No record has been found,
to generate Reports", (int)Hasan.CMessageBox.Type.Exclamation,
Location.X, Location.Y);
return;
}
this.chart.Titles.Add(SetTitle());
System.Windows.Forms.DataVisualization.Charting.Series series =
new System.Windows.Forms.DataVisualization.Charting.Series();
series.BorderColor = System.Drawing.Color.FromArgb
(((int)(((byte)(64)))), ((int)(((byte)(64)))),
((int)(((byte)(64)))), ((int)(((byte)(64)))));
series.ChartArea = "Area1";
series.ChartType =
System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie;
series.Color = System.Drawing.Color.FromArgb
(((int)(((byte)(180)))), ((int)(((byte)(65)))),
((int)(((byte)(140)))), ((int)(((byte)(240)))));
series.CustomProperties = "DoughnutRadius=15,
PieDrawingStyle=Concave, CollectedLabel=Other, MinimumRelative" +
"PieSize=10";
series.Font = new System.Drawing.Font("Trebuchet MS", 8.25F,
System.Drawing.FontStyle.Bold);
series.Label = "#PERCENT{P1}";
series.Legend = "Default";
series.MarkerStyle =
System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
series.Name = "Default";
series.XValueType =
System.Windows.Forms.DataVisualization.Charting.ChartValueType.Double;
series.YValueType =
System.Windows.Forms.DataVisualization.Charting.ChartValueType.Double;
System.Windows.Forms.DataVisualization.Charting.DataPoint dataPoint1 =
new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, 0);
int amount = 0;
for (int i = 0; i < rows.Length; i++)
{
amount = pseg.ProcessItem(i);
dataPoint1 =
new System.Windows.Forms.DataVisualization.Charting.DataPoint(0, amount);
dataPoint1.CustomProperties = "OriginalPointIndex=" + i.ToString();
dataPoint1.IsValueShownAsLabel = false;
dataPoint1.LegendText = rows[i]["Name"].ToString();
if( !chkPercentage.Checked )
dataPoint1.Label = rows[i]["Name"].ToString();
series.Points.Add(dataPoint1);
}
this.chart.Series.Add(series);
chart.Series[0].Font = new Font("Trebuchet MS", 8, FontStyle.Bold);
chart.Series[0]["CollectedToolTip"] = "Other";
chart.Series["Default"]["PieLabelStyle"] = "Outside";
if (ChkCollectSlices.Checked)
{
chart.Series["Default"]["CollectedThreshold"] = combThershold.Text;
combThershold.Enabled = true;
}
else
{
combThershold.Enabled = false;
}
if (chart.Series.Count > 1)
{
chart.Series.RemoveAt(1);
chart.ChartAreas.RemoveAt(1);
chart.ChartAreas["Default"].Position.Auto = true;
}
pieHelper = new PieCollectedDataHelper(chart);
pieHelper.CollectedLabel = String.Empty;
if (chkSupplementChart.Checked)
{
chart.Series["Default"]["PieLabelStyle"] = "Outside";
pieHelper.CollectedPercentage = double.Parse(combThershold.Text);
pieHelper.ShowCollectedDataAsOneSlice = chkCollectSmallSegment.Checked;
if (combSupplementSize.SelectedIndex == 0)
{
pieHelper.SupplementedAreaSizeRatio = 0.9f;
}
else if (combSupplementSize.SelectedIndex == 1)
{
pieHelper.SupplementedAreaSizeRatio = 1.0f;
}
else if (combSupplementSize.SelectedIndex == 2)
{
pieHelper.SupplementedAreaSizeRatio = 1.1f;
}
pieHelper.ChartAreaPosition = new RectangleF(3f, 3f, 93f, 96f);
pieHelper.ShowSmallSegmentsAsSupplementalPie("Default");
}
else
{
chart.Series["Default"]["PieLabelStyle"] = "Outside";
chart.Series["Default"].LabelBackColor = Color.Empty;
}
timer1.Interval = 10;
timer1.Enabled = true;
}
#endregion
Bar Chart
The code for bar chart is as under:
#region Bar Chart
private void InitializeBarColumn()
{
this.chart = SetChart();
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
this.SuspendLayout();
this.ReportPanel.Controls.Add(this.chart);
BarColumnChartTypeLoad();
((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
this.ResumeLayout(false);
}
private void BarColumnChartTypeLoad()
{
Main.ChartDialog.PlantSegregation pseg =
new ISCMS.Main.ChartDialog.PlantSegregation
(_plantSegment, _charts, _chartBy, _is_Segregation, this);
rows = pseg.Process();
if (rows.Length == 0)
{
ReportPanel.Controls.Clear();
Hasan.CMessageBoxSmall.ShowBox("No record has been found,
to generate Reports", (int)Hasan.CMessageBox.Type.Exclamation,
Location.X, Location.Y);
return;
}
this.chart.Titles.Add(SetTitle());
System.Windows.Forms.DataVisualization.Charting.Series series =
new System.Windows.Forms.DataVisualization.Charting.Series();
series.ChartArea = "Default";
series.Legend = "Default";
series.Name = "series";
series.XValueType =
System.Windows.Forms.DataVisualization.Charting.ChartValueType.DateTime;
this.chart.Series.Clear();
this.chart.Series.Add(series);
TimeSpan ts = DateTime.Now - new DateTime(1900, 1, 1);
double days = ts.Days;
double days2 = days;
int amount = 0;
for (int pointIndex = 0; pointIndex < rows.Length; pointIndex++)
{
amount = pseg.ProcessItem(pointIndex);
ts = DateTime.Parse(rows[pointIndex]["Date"].ToString()) -
new DateTime(1900, 1, 1);
series.Points.AddXY(ts.Days, amount);
}
series.Color = _serial_Color;
if (chkMargin.Checked)
chart.ChartAreas["Default"].AxisX.IsMarginVisible = true;
else
chart.ChartAreas["Default"].AxisX.IsMarginVisible = false;
if (this.chkDisplayBar3D.Checked)
{
series.BorderColor = System.Drawing.Color.Transparent;
chart.ChartAreas["Default"].Area3DStyle.Enable3D = true;
}
else
{
series.BorderColor = System.Drawing.Color.Teal;
chart.ChartAreas["Default"].Area3DStyle.Enable3D = false;
}
chart.ChartAreas[0].AxisX.LabelStyle.IntervalOffset = 1;
chart.ChartAreas[0].AxisX.LabelStyle.IntervalOffsetType =
System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Days;
chart.ChartAreas[0].AxisX.LabelStyle.Interval = 2;
chart.ChartAreas[0].AxisX.LabelStyle.IntervalType =
System.Windows.Forms.DataVisualization.Charting.DateTimeIntervalType.Days;
}
#endregion
Kagi Chart
Kagi chart is used to monitor material or finished goods rate over a period of time. This chart can be established by the following code:
#region Kagi Chart
private void InitializeKagiChart()
{
this.chart = SetChart();
((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
this.SuspendLayout();
this.ReportPanel.Controls.Add(this.chart);
KagiChartTypeLoad();
((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
this.ResumeLayout(false);
}
private void KagiChartTypeLoad()
{
Main.ChartDialog.PlantSegregation pseg =
new ISCMS.Main.ChartDialog.PlantSegregation
(_plantSegment, _charts, _chartBy, _is_Segregation, this);
rows = pseg.Process();
if (rows.Length == 0)
{
ReportPanel.Controls.Clear();
Hasan.CMessageBoxSmall.ShowBox("No record has been found,
to generate Reports", (int)Hasan.CMessageBox.Type.Exclamation,
Location.X, Location.Y);
return;
}
DataSet ds = new DataSet();
ds.Merge(rows);
System.Windows.Forms.DataVisualization.Charting.Series series =
new System.Windows.Forms.DataVisualization.Charting.Series();
series.BorderColor = System.Drawing.Color.Teal;
series.BorderWidth = 3;
series.ChartArea = "Default";
series.ChartType =
System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Kagi;
series.Color = System.Drawing.Color.Tomato;
series.CustomProperties = "PriceUpColor=SkyBlue";
series.IsXValueIndexed = true;
series.Legend = "Default";
series.Name = "Default";
series.ShadowColor = System.Drawing.Color.Gainsboro;
series.ShadowOffset = 2;
series.XValueType =
System.Windows.Forms.DataVisualization.Charting.ChartValueType.Date;
series.YValueType =
System.Windows.Forms.DataVisualization.Charting.ChartValueType.Double;
this.chart.Titles.Add(SetTitle());
series.Points.Clear();
double bufRate = 0;
TimeSpan ts;
for (int pointIndex = 0; pointIndex < rows.Length; pointIndex++)
{
ts = DateTime.Parse(rows[pointIndex]["Date"].ToString()) -
new DateTime(1900, 1, 1);
if (ds.Tables[0].Select(" Date = #" +
DateTime.Parse(rows[pointIndex]["Date"].ToString()).ToShortDateString()
+ "#").Length > 0) {
series.Points.AddXY(ts.Days, Convert.ToDouble(rows[pointIndex]
["Unit_Cost"]));
bufRate = Convert.ToDouble(rows[pointIndex]["Unit_Cost"]);
}
else
series.Points.AddXY(ts.Days, bufRate);
}
series["ReversalAmount"] = combReversalAmount.Text;
this.chart.Series.Add(series);
}
#endregion
History
- 8th October, 2009: Initial post