void INAutoUpdateCallback.OnAutoUpdate(NAspNetThinWebControl control) { NThinChartControl chartControl = (NThinChartControl)control; NBarSeries bar = (NBarSeries)chartControl.Charts[0].Series[0]; int index = (int)chartControl.CustomData; for (int i = 0; i < bar.FillStyles.Count; i++) { NColorFillStyle colorFill = bar.FillStyles[i] as NColorFillStyle; if (i != index) { colorFill.Color = Color.FromArgb(60, colorFill.Color); } else { colorFill.Color = Color.FromArgb(255, colorFill.Color); } } index++; if (index >= bar.FillStyles.Count) { index = 0; } chartControl.CustomData = index; chartControl.UpdateView(); }
public void OnAutoUpdate(NAspNetThinWebControl control) { NThinChartControl chartControl = (NThinChartControl)control; NLineSeries line = (NLineSeries)chartControl.Charts[0].Series[0]; if (line == null) { return; } if (line.Values.Count == 0) { return; } double dPrev = (double)line.Values[line.Values.Count - 1]; double yValue = GenerateDataPoint(dPrev, new NRange1DD(50, 350)); line.Values.RemoveAt(0); line.XValues.RemoveAt(0); line.Values.Add(yValue); line.XValues.Add(DateTime.Now.ToOADate()); chartControl.UpdateView(); }
public void OnMouseEvent(NAspNetThinWebControl control, NBrowserMouseEventArgs e) { NThinChartControl chartControl = (NThinChartControl)control; NPieChart pieChart = (NPieChart)chartControl.Charts[0]; NHitTestResult hitTestResult = chartControl.HitTest(e.X, e.Y); int dataPointIndex = hitTestResult.DataPointIndex; // collapse all pie slices NPieSeries pieSeries = (NPieSeries)pieChart.Series[0]; for (int i = 0; i < pieSeries.Values.Count; i++) { pieSeries.Detachments[i] = 0; } // expand the one that's hit if (dataPointIndex != -1) { pieSeries.Detachments[dataPointIndex] = 5.0f; } chartControl.UpdateView(); }
void INMouseEventCallback.OnMouseEvent(NAspNetThinWebControl control, NBrowserMouseEventArgs e) { NThinChartControl chartControl = (NThinChartControl)control; NPieChart pieChart = (NPieChart)chartControl.Charts[0]; NPieSeries pieSeries = (NPieSeries)pieChart.Series[0]; for (int i = 0; i < pieSeries.Values.Count; i++) { pieSeries.Detachments[i] = 5.0f; } chartControl.UpdateView(); }
void INAutoUpdateCallback.OnAutoUpdateStateChanged(NAspNetThinWebControl control) { // reset colors NThinChartControl chartControl = (NThinChartControl)control; NBarSeries bar = (NBarSeries)chartControl.Charts[0].Series[0]; int index = (int)chartControl.CustomData; for (int i = 0; i < bar.FillStyles.Count; i++) { NColorFillStyle colorFill = bar.FillStyles[i] as NColorFillStyle; colorFill.Color = Color.FromArgb(255, colorFill.Color); } chartControl.CustomData = 0; chartControl.UpdateView(); }
void INActivatePanelCallback.OnActivatePanel(NThinChartControl control, NContentPanel newActivePanel, NContentPanel oldActivePanel) { // when the currently active panel changes, change its border to prompt the user if (oldActivePanel != null) { oldActivePanel.BorderStyle = null; } if (newActivePanel != null) { NStrokeBorderStyle border = new NStrokeBorderStyle(BorderShape.RoundedRect); border.StrokeStyle.Color = Color.Red; newActivePanel.BorderStyle = border; } control.UpdateView(); }
void INTrackballCallback.OnTrackball(NThinChartControl control, NChart chart, float oldRotation, float oldElevation) { control.Labels[0].Text = "Trackball Tool<br/><font size='10pt'> Rotation[" + chart.Projection.Rotation.ToString() + "], Elevation [" + chart.Projection.Elevation.ToString() + "]</font>"; control.UpdateView(); }