2014-07-23 6 views
0

winforms의 deveexpress 1.14 꺾은 선형 차트에서 클릭 한 점을 얻으려고합니다. LineSeriesView MarkerVisibility가 true로 설정되어 있으면 잘 작동하지만 점을 그렇게 표시하지 않으려면 점선이 필요합니다. 어떻게하지 않고 Seriespoint를 얻을 수 있습니까?눈금 표시없이 Devexpress 꺾은 선형 차트에서 클릭 한 점 얻기

private void chart_MouseClick(object sender, MouseEventArgs e) { 
    // Obtain the object being clicked. 
    ChartHitInfo hi = chart.CalcHitInfo(e.X, e.Y); 
    // Check whether it was a series point, and if yes - 
    // obtain its argument, and pass it to the detail series. 
    SeriesPoint point = hi.SeriesPoint; // hi.SeriesPoint IS NULL 

    if (point != null) { 
     // do stuff 

    } 
} 

runtimeHitTesting는 차트 감사에 대해입니다!

답변

1

가 해킹 :

void chart_CustomDrawSeries(object sender, CustomDrawSeriesEventArgs e) 
    { 
     LineDrawOptions drawOptions = e.SeriesDrawOptions as LineDrawOptions; 
     if (drawOptions == null) 
      return; 
     drawOptions.Marker.Color = Color.Transparent; 
     drawOptions.Marker.BorderColor = Color.Transparent; 
    } 

Remeber 설정할`this.chart.CacheToMemory = TRUE; 그래서 그 사건은 항상 발동하지 않습니다.

관련 문제