Hi,
ZedGraph does not do polar plots directly, but there is a "RadarPointList" class that you can use instead of PointPairList. This class will translate the coordinates to polar values. Below is a sample.
John
for ( int i = 0; i < 10; i++ )
{
double r = rand.NextDouble() * 10.0 + 10.0;
PointPair pt = new PointPair( PointPair.Missing, r, "r = " + r.ToString( "f1" ) );
rpl.Add( pt );
}
LineItem curve = myPane.AddCurve( "test", rpl, Color.Blue, SymbolType.Default );
for ( int i = 0; i < 10; i++ )
{
LineObj line = new ArrowObj( 0, 0, (float)rpl[i].X, (float)rpl[i].Y );
line.Color = Color.LightBlue;
line.ZOrder = ZOrder.D_BehindCurves;
myPane.GraphObjList.Add( line );
}
Hi, what I see is that you only give the radius, but the angle is set automatically distributing the points between 0 and 360 degrees, is that right? is it possible to set both polar coordinates, radius and angle?
many thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is it at all possible to put a RadarPoint example on the examples page? This is a very cool feature of ZedGraph and shows how powerful it is, but you have to dig really really deep to find that ZedGraph can do this ...
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Awsome software and very easy to program! thanks a million:)
Any plans to add support for polar or radar charts?
Thanks
Mehrdad
Hi,
ZedGraph does not do polar plots directly, but there is a "RadarPointList" class that you can use instead of PointPairList. This class will translate the coordinates to polar values. Below is a sample.
John
private void CreateGraph_RadarPlot( ZedGraphControl z1 )
{
GraphPane myPane = z1.GraphPane;
RadarPointList rpl = new RadarPointList();
Random rand = new Random();
for ( int i = 0; i < 10; i++ )
{
double r = rand.NextDouble() * 10.0 + 10.0;
PointPair pt = new PointPair( PointPair.Missing, r, "r = " + r.ToString( "f1" ) );
rpl.Add( pt );
}
LineItem curve = myPane.AddCurve( "test", rpl, Color.Blue, SymbolType.Default );
for ( int i = 0; i < 10; i++ )
{
LineObj line = new ArrowObj( 0, 0, (float)rpl[i].X, (float)rpl[i].Y );
line.Color = Color.LightBlue;
line.ZOrder = ZOrder.D_BehindCurves;
myPane.GraphObjList.Add( line );
}
myPane.XAxis.MajorTic.IsAllTics = true;
myPane.XAxis.MinorTic.IsAllTics = true;
myPane.XAxis.Title.IsTitleAtCross = false;
myPane.XAxis.Cross = 0;
myPane.XAxis.Scale.IsSkipFirstLabel = true;
myPane.XAxis.Scale.IsSkipLastLabel = true;
myPane.XAxis.Scale.IsSkipCrossLabel = true;
myPane.YAxis.MajorTic.IsAllTics = true;
myPane.YAxis.MinorTic.IsAllTics = true;
myPane.YAxis.Title.IsTitleAtCross = false;
myPane.YAxis.Cross = 0;
myPane.YAxis.Scale.IsSkipFirstLabel = true;
myPane.YAxis.Scale.IsSkipLastLabel = true;
myPane.YAxis.Scale.IsSkipCrossLabel = true;
}
Hi, what I see is that you only give the radius, but the angle is set automatically distributing the points between 0 and 360 degrees, is that right? is it possible to set both polar coordinates, radius and angle?
many thanks
Is it at all possible to put a RadarPoint example on the examples page? This is a very cool feature of ZedGraph and shows how powerful it is, but you have to dig really really deep to find that ZedGraph can do this ...
Thanks