private void SetMaxXAxis(XAxisCounter counter) { if (_chart.TryGetFirstArea(out ChartArea area)) { area.AxisX.Maximum = counter.Value; } }
private void HandleMetrics(Metric metric, bool paused) { if (_seriesIndex.TryGetValue(metric.Series, out Series series)) { chartRenderActor.Tell( new ChartRender(series, paused ? 0 : metric.CounterValue)); } var xAxisCounter = new XAxisCounter(xPosCounter++); _chartBoundariesActor.Tell(xAxisCounter); _chartBoundariesActor.Tell(maxPoints); SetYBoundary(); chartRenderActor.Tell(xAxisCounter); chartRenderActor.Tell(maxPoints); }
private void HandleInitialize(InitializeChart ic) { if (ic.InitialSeries != null) { //swap the two series out _seriesIndex = ic.InitialSeries; } //delete any existing series _chart.Series.Clear(); // set the axes up var area = _chart.ChartAreas[0]; area.AxisX.IntervalType = DateTimeIntervalType.Number; area.AxisY.IntervalType = DateTimeIntervalType.Number; //attempt to render the initial chart if (_seriesIndex.Any()) { foreach (var series in _seriesIndex) { //force both the chart and the internal index to use the same names series.Value.Name = series.Key; _chart.Series.Add(series.Value); } } var xAxisCounter = new XAxisCounter(); _chartBoundariesActor.Tell(maxPoints); _chartBoundariesActor.Tell(xAxisCounter); SetYBoundary(); chartRenderActor.Tell(maxPoints); chartRenderActor.Tell(xAxisCounter); }