c# MS chart get scrollbar value

122 views Asked by At

It is possible to get value of X scrollbar from zoomed Chart? Anybody can help me? In Datagrdiview I hande with it by using dataGridView1.FirstDisplayedCell.RowIndex;

1

There are 1 answers

0
user3447900 On BEST ANSWER

I found the solution after few days and nights. I used these functions before, but I can't connect them. This solution show which number of point is shown as a first and number of end point from collection.

private void chart1_AxisViewChanged(object sender, ViewEventArgs e)
    {
        if (!allowReadData)
            allowReadData = true;
    }

private void timer4_Tick(object sender, EventArgs e)
    {
        if (allowReadData && MouseButtons != MouseButtons.Left)
        {
            allowReadData = false;
            double xMin = chart1.ChartAreas[0].AxisX.ScaleView.ViewMinimum;
            double xMax = chart1.ChartAreas[0].AxisX.ScaleView.ViewMaximum;
            MessageBox.Show("Minimum: " + xMin+"\nMaximum: "+xMax);
        }
    }