The Pressure series class from attached code overrides GetLabel to return Sample.Label for LabelKinds.ToolTip - does that tooltip appear when the mouse pointer hovers over a point? Instead of the Sample.Label property value, you could return concatenated Sample.Value and Sample.Time from GetLabel.
One way to draw those lines is by passing their coordinates to a custom SeriesRenderer object added to the plot:
class MarkerLineRenderer : Renderer2D
{
public MarkerLineRenderer(SimpleSeries series) :
base(new ObservableCollection<Series> { series })
{
}
protected override void Draw(RenderContext context)
{
var series = Series[0];
for (int i = 0; i < series.Size; i++)
{
double x = series.GetValue(i, 0);
var point = GetPixel(x, context.XAxis, 0, context.YAxis, context.Component);
context.Graphics.DrawLine(
Pens.Red, point.X, 0, point.X, (float)context.Component.ActualHeight);
};
}
}
var markerCoords = new SimpleSeries(
new double[] { 5, 20 }, null);
lineChart.Plot.SeriesRenderers.Add(
new MarkerLineRenderer(markerCoords));
the coordinates being relative to the chart's X axis range. You could get the values from e.g. TrackBar controls, or possibly implement a custom PlotController class to let users draw the range interactively inside the plot.
Regards,
Slavcho
Mindfusion