public void ReDrawingLineAndNode()
{
index = 0;//Reset the index as fresh data is going to be inserted
//--This is for replotting all the things again...
series1.Points.Clear();
for (int i = 0; i < menuStripNodeLineInfoValues.Count; i++)//-- this -1 is done because for three points we have two line series..
{
//chart1.Series.Remove(menuStripNodeLineInfoValues[i].lineSeriesID);
menuStripNodeLineInfoValues[i].lineSeriesID.Points.Clear();
}
//--this is redraw functionality
//foreach(var values in menuStripNodeInfoValues)
for (int x = 0; x < menuStripNodeInfoValues.Count; x++)
{
string labelValue;
if (menuStripNodeInfoValues[x].showItemText == "Label")
{
labelValue = menuStripNodeInfoValues[x].label;
}
else if (menuStripNodeInfoValues[x].showItemText == "Name")
{
labelValue = menuStripNodeInfoValues[x].name;
}
else
{
labelValue = menuStripNodeInfoValues[x].source;
}
ReDrawPoints(series1, menuStripNodeInfoValues[x].xVal, menuStripNodeInfoValues[x].yVal, menuStripNodeInfoValues[x].colorValue, menuStripNodeInfoValues[x].source, menuStripNodeInfoValues[x].name, menuStripNodeInfoValues[x].label, labelValue);
incrementIndex++;
index++;
}
//--resetting incrementIndex
incrementIndex = 0;
if (menuStripNodeLineInfoValues.Count > 0)
{
for (int x = 0; x < menuStripNodeLineInfoValues.Count; x++)
{
incrementIndex++;
ReDrawLines(menuStripNodeLineInfoValues[x].ID, menuStripNodeLineInfoValues[x].prevNodeId, menuStripNodeLineInfoValues[x].nextNodeId, menuStripNodeLineInfoValues[x].lineSeriesID, menuStripNodeLineInfoValues[x].lineColorValue);
}
}
chart1.Invalidate();
incrementIndex = 0;//reset the values again..
}