我正试图在winforms的deveexpress 1.14折线图上点击点。它可以正常工作,LineSeriesView MarkerVisibility设置为true,但我不希望这些点被标记为,我想要一个smoth行。如何在不这样做的情况下获得Seriespoint?
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已启用 谢谢!
答案 0 :(得分: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;
}
记得设置`this.chart.CacheToMemory = true;所以事件不会一直开火。