Is there a sample for a phase chart?

I want to make something like this:

What I get is this:


Any same code I can look at?  Helpful tips? 

Thank you!
Beth

3 Replies 1 reply marked as answer

SJ Suyamburaja Jayakumar Syncfusion Team June 11, 2020 03:12 PM UTC

Hi Beth Taylor, 
 
Greetings from Syncfusion. 
 
We have prepared sample for your requirement, it will be downloaded from below location.  
 
Screenshot: 
 
 
If the sample provided does not meet your requirements, please provide the exact requirement of your application. This will be helpful for us to investigate further and provide you a better solution at the earliest.  
 
Regards, 
Suyamburaja J. 


Marked as answer

BT Beth Taylor June 11, 2020 05:18 PM UTC

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;
            }
        }


SJ Suyamburaja Jayakumar Syncfusion Team June 14, 2020 02:09 PM UTC

Hi Beth Taylor, 
 
Thanks for your update. 
 
Could you please provide some more information like datapoints etc.it will be helpful for us to analyze your requirement?  
 
Regards, 
Suyamburaja J. 
 


Loader.
Up arrow icon