cross hair on chart in c# -
i created cross hair or chart , , working, want change position of y-axis form left right (i fixed form chart properties-> series(collection)->y-axis type change primary secondary )then show x-axis line, want y-asix, how can fix it, code below..
//for x axis line chart1.chartareas[0].cursorx.linewidth = 1; chart1.chartareas[0].cursorx.linedashstyle = chartdashstyle.solid; chart1.chartareas[0].cursorx.linecolor = color.red; //chart1.chartareas[0].cursorx.selectioncolor = color.yellow; //for y axis line chart1.chartareas[0].cursory.linewidth = 1; chart1.chartareas[0].cursory.linedashstyle = chartdashstyle.solid; chart1.chartareas[0].cursory.linecolor = color.darkslateblue; chart1.chartareas[0].cursorx.interval = 0; chart1.chartareas[0].cursory.interval = 0; chart1.chartareas[0].cursorx.setcursorpixelposition(mousepoint, true); chart1.chartareas[0].cursory.setcursorpixelposition(mousepoint, true); label2.text = "pixel of x=" + chart1.chartareas[0].axisx.pixelpositiontovalue(e.x).tostring(); label3.text = "pixel of x2=" + chart1.chartareas[0].axisy2.pixelpositiontovalue(e.y).tostring();
use axisy2
instead:
label2.text = "pixel of x position = " + chart1.chartareas[0].axisx.pixelpositiontovalue(e.x).tostring("0.00"); label3.text = "pixel of y position = " + chart1.chartareas[0].axisy2.pixelpositiontovalue(e.y).tostring("0.00");
Comments
Post a Comment