Thank you. The sample code was very useful.
I am also having a problem displaying the points.
The red line is incorrect but the blue line is good. Here is an example, the point should have been around -60, 30. Can you please tell me how to get the points to show correctly for both the red and blue lines?
Here is my code:
ChartSeries redPointSeries = new ChartSeries("Bubble Point", ChartSeriesType.Line);
redPointSeries.Style.Interior = new Syncfusion.Drawing.BrushInfo(Color.Red);
foreach (GraphData data in redPoints)
{
redPointSeries.Points.Add( data.Temperature, data.Pressure);
}
redPointSeries.SortPoints = true;
redPointSeries.SortBy = ChartSeriesSortingType.Y;
redPointSeries.SortOrder = ChartSeriesSortingOrder.Ascending;
ChartSeries bluePointSeries = new ChartSeries("Dew Point", ChartSeriesType.Line);
bluePointSeries .Style.Interior = new Syncfusion.Drawing.BrushInfo(Color.Blue);
foreach (GraphData data in bluePoint)
{
bluePointSeries.Points.Add(data.Temperature, data.Pressure);
}
bluePointSeries.SortPoints = true;
bluePointSeries.SortBy = ChartSeriesSortingType.Y;
bluePointSeries.SortOrder = ChartSeriesSortingOrder.Ascending;
chartPhaseDiagram.ShowToolTips = true;
chartPhaseDiagram.Series.Add(redPointSeries);
chartPhaseDiagram.Series.Add(bluePointSeries);
chartPhaseDiagram.Series[0].PrepareStyle += PhaseDiagram_PrepareStyleredPoint;
chartPhaseDiagram.Series[1].PrepareStyle += PhaseDiagram_PrepareStylebluePoint;
--------------------------------------------
private void PhaseDiagram_PrepareStyleredPoint(object sender, ChartPrepareStyleInfoEventArgs args)
{
ChartSeries series = sender as ChartSeries;
if (series != null)
{
args.Style.ToolTip = series.Points[args.Index].X.ToString("0.000") + "," + series.Points[args.Index].YValues[0].ToString("0.000");
args.Handled = true;
}
}
private void PhaseDiagram_PrepareStylebluePoint(object sender, ChartPrepareStyleInfoEventArgs args)
{
ChartSeries series = sender as ChartSeries;
if (series != null)
{
args.Style.ToolTip = series.Points[args.Index].X.ToString("0.000") + "," + series.Points[args.Index].YValues[0].ToString("0.000");
args.Handled = true;
}
}