private LineDataSet CreateLineDataSet(Color mcolor, string mLabel, List <float> MotionList) { LineDataSet set = new LineDataSet(null, "Data") { AxisDependency = YAxis.AxisDependency.Left, LineWidth = 2.5f, Color = mcolor, HighlightEnabled = false, Label = mLabel }; set.SetDrawValues(false); set.SetDrawCircles(false); set.SetMode(LineDataSet.Mode.CubicBezier); set.CubicIntensity = 0.1f; if (MotionList.Count > max_OnCreateEntries) { for (int i = 0; i < max_OnCreateEntries; i++) { set.AddEntry(new Entry(i, MotionList[i])); } } else { for (int i = 0; i < MotionList.Count; i++) { set.AddEntry(new Entry(i, MotionList[i])); } } return(set); }
//UPDATE THE APPROPRIATE SET ACCORDING WITH THREAT TYPE AND UPDATING LINE CHART public void GetThreatData(Threat threat, float manageTime) { //Debug.Log(lineChart); if (sets.Count == 0) { SetupChartDataSets(); } switch (threat.threatAttack) { case StaticDb.ThreatAttack.dos: dosSet.AddEntry(new LineEntry(threat.id, (float)Math.Round(manageTime, 1))); break; case StaticDb.ThreatAttack.phishing: break; case StaticDb.ThreatAttack.replay: replaySet.AddEntry(new LineEntry(threat.id, (float)Math.Round(manageTime, 1))); break; case StaticDb.ThreatAttack.mitm: mitmSet.AddEntry(new LineEntry(threat.id, (float)Math.Round(manageTime, 1))); break; case StaticDb.ThreatAttack.stuxnet: stuxnetSet.AddEntry(new LineEntry(threat.id, (float)Math.Round(manageTime, 1))); break; case StaticDb.ThreatAttack.dragonfly: dragonflySet.AddEntry(new LineEntry(threat.id, (float)Math.Round(manageTime, 1))); break; case StaticDb.ThreatAttack.malware: malwareSet.AddEntry(new LineEntry(threat.id, (float)Math.Round(manageTime, 1))); break; case StaticDb.ThreatAttack.createRemote: break; case StaticDb.ThreatAttack.fakeLocal: break; case StaticDb.ThreatAttack.timeEvent: break; default: throw new ArgumentOutOfRangeException(); } ClassDb.logManager.StartWritePlayerLogRoutine(StaticDb.player, StaticDb.logEvent.UserEvent, "THREAT " + threat.threatAttack.ToString().ToUpper() + " MANAGED AFTER " + manageTime + " SECONDS"); }
private void DrawFunction(LineDataSet dataSet) { if (!osc.IsOn) { return; } dataSet.Clear(); var g = osc.Graph; for (int i = 0; i < g.Length; i++) { dataSet.AddEntry(new LineEntry((float)g[i].X, (float)g[i].Y)); } chart.GetChartData().DataSets.Add(dataSet); chart.SetDirty(); }
private LineDataSet CreateLineDataSet(Color mcolor, string mLabel) { LineDataSet set = new LineDataSet(null, "Data") { AxisDependency = YAxis.AxisDependency.Left, LineWidth = 3f, Color = mcolor, HighlightEnabled = false, Label = mLabel }; set.SetDrawValues(false); set.SetDrawCircles(false); set.SetMode(LineDataSet.Mode.CubicBezier); set.CubicIntensity = 0.1f; set.AddEntry(new Entry(0, 0)); return(set); }