Ejemplo n.º 1
0
        void nChartControl1_MouseDown(object sender, MouseEventArgs e)
        {
            NViewToScale1DTransformation viewToScale = new NViewToScale1DTransformation(nChartControl1.View.Context, nChartControl1.Charts[0], (int)StandardAxis.PrimaryX, (int)StandardAxis.PrimaryY);

            if (viewToScale.Transform(new NPointF(e.X, e.Y), ref _rangeStart))
            {
            }
        }
Ejemplo n.º 2
0
        void nChartControl1_MouseUp(object sender, MouseEventArgs e)
        {
            NViewToScale1DTransformation viewToScale = new NViewToScale1DTransformation(nChartControl1.View.Context, nChartControl1.Charts[0], (int)StandardAxis.PrimaryX, (int)StandardAxis.PrimaryY);

            double value = 0;

            if (viewToScale.Transform(new NPointF(e.X, e.Y), ref value))
            {
                var max = Math.Max(_rangeStart, value);
                var min = Math.Min(_rangeStart, value);
                if (Math.Abs(max - min) > 5)
                {
                    this.addRange(min, max, this.getRandomColor());
                }
            }
        }