티스토리 뷰

카테고리 없음

zed그래프 클릭하면 빨간 선 나오기

뽀로로친구에디 2019. 1. 23. 11:30

  PointPairList userClickrList = new PointPairList();

        LineItem userClickCurve = new LineItem("userClickCurve");



        private void z2_MouseClick(object sender, MouseEventArgs e)  // ZedGraph 클릭시 빨간선 나옴. 

        {

            // Create an instance of Graph Pane

            GraphPane myPane = z2.GraphPane;


            // x & y variables to store the axis values

            double xVal;

            double yVal;


            // Clear the previous values if any

            userClickrList.Clear();


            myPane.Legend.IsVisible = false;


            // Use the current mouse locations to get the corresponding 

            // X & Y CO-Ordinates

            myPane.ReverseTransform(e.Location, out xVal, out yVal);


            // Create a list using the above x & y values

            userClickrList.Add(xVal, myPane.YAxis.Scale.Max);

            userClickrList.Add(xVal, myPane.YAxis.Scale.Min);


            // Add a curve

            userClickCurve = myPane.AddCurve(" ", userClickrList, Color.Red, SymbolType.None);


            z2.Refresh();

        }

댓글
최근에 달린 댓글
글 보관함
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
Total
Today
Yesterday
    뽀로로친구에디
    최근에 올라온 글