void INCustomRequestCallback.OnCustomRequestCallback(NAspNetThinWebControl control, NRequestContext context, string argument)
            {
                NThinChartControl chartControl = (NThinChartControl)control;

                NChart     chart = chartControl.Charts[0];
                NBarSeries bar   = (NBarSeries)chart.Series[0];

                bar.DataLabelStyles.Clear();

                switch (argument)
                {
                case "ShowDataLabels":
                {
                    bar.DataLabelStyle.Visible = true;
                }
                break;

                case "HideDataLabels":
                {
                    bar.DataLabelStyle.Visible = false;
                }
                break;
                }

                // update the control and toolbar
                chartControl.Update();
            }
示例#2
0
            void INCustomRequestCallback.OnCustomRequestCallback(NAspNetThinWebControl control, NRequestContext context, string argument)
            {
                NThinChartControl chartControl = (NThinChartControl)control;

                // make sure chart is recalculated
                chartControl.RecalcLayout();

                NChart       chart = chartControl.Charts[0];
                NStockSeries stock = (NStockSeries)chart.Series[0];

                switch (argument)
                {
                case "LastWeek":
                {
                    DateTime dt = DateTime.FromOADate((double)stock.XValues[stock.XValues.Count - 1]);
                    chart.Axis(StandardAxis.PrimaryX).PagingView.ZoomIn(new NRange1DD(dt.AddDays(-7).ToOADate(), dt.ToOADate()), 0.00001);
                }
                break;

                case "LastMonth":
                {
                    DateTime dt = DateTime.FromOADate((double)stock.XValues[stock.XValues.Count - 1]);
                    chart.Axis(StandardAxis.PrimaryX).PagingView.ZoomIn(new NRange1DD(dt.AddMonths(-1).ToOADate(), dt.ToOADate()), 0.00001);
                }
                break;

                case "LastYear":
                    chart.Axis(StandardAxis.PrimaryX).PagingView.Enabled = false;
                    break;
                }

                chartControl.Update();
            }
示例#3
0
            void INDataPanCallback.OnDataPan(NThinChartControl control, NCartesianChart chart, NAxis horzAxis, NAxis vertAxis)
            {
                control.RecalcLayout();

                NLabel label = control.Labels[0];

                label.Text = FormatLabel(horzAxis.Scale.RulerRange, vertAxis.Scale.RulerRange);

                control.Update();
            }
示例#4
0
            void INScrollbarCallback.OnScroll(NThinChartControl control, NCartesianChart chart, NAxis axis)
            {
                control.RecalcLayout();

                NAxis horzAxis = chart.Axis(StandardAxis.PrimaryX);
                NAxis vertAxis = chart.Axis(StandardAxis.PrimaryY);

                NLabel label = control.Labels[0];

                label.Text = FormatLabel(horzAxis.Scale.RulerRange, vertAxis.Scale.RulerRange);

                control.Update();
            }