Rose Series help

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
jdom
Newbie
Newbie
Posts: 4
Joined: Tue Dec 09, 2014 12:00 am

Rose Series help

Post by jdom » Thu Feb 12, 2015 12:45 pm

hello. many thanks for including Rose Series in the Xamarin.Forms release.

i'm totally lost as to how to use it, tho. and i cannot find any documentation anywhere (maybe I'm just not seeing it...) various code samples online show a .AddXY or .AddPolar function; but all I'm seeing is overloads of .Add(). i've tried many combinations of those but results remain unpredictable. i think i'm missing some key conceptual point.

how can i simply add a few "slices" to a RoseSeries? .Add (Angle, Radius, ....?)

thank you.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Rose Series help

Post by Christopher » Fri Feb 13, 2015 12:26 pm

Hello,

Once you have the sample project under:

%Program Files%\Steema Software\TeeChart for Xamarin Forms 2015 4.0.2015.02060\Examples\SampleProject

up and running, you can add a single slice to a rose series like this:

Code: Select all

namespace SampleProject
{
  public class App
  {
    public static Page GetMainPage()
    {
      var tChart1 = new Steema.TeeChart.Chart();

      tChart1.Aspect.View3D = false;
      tChart1.Legend.Visible = false;
      Steema.TeeChart.Styles.Rose rose = new Steema.TeeChart.Styles.Rose(tChart1.Chart);

      rose.Circled = true;
      rose.Add(45, 100);
      rose.Add(90, 200);
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

jdom
Newbie
Newbie
Posts: 4
Joined: Tue Dec 09, 2014 12:00 am

Re: Rose Series help

Post by jdom » Fri Feb 13, 2015 8:34 pm

Code: Select all

 
rose.Add(45, 100, green);
rose.Add(90, 200, green);
gives this:
versiona.png
versiona.png (38.23 KiB) Viewed 7250 times

Code: Select all

 
rose.Add(45, 100, green);
rose.Add(90, 200, green);
rose.Add(135, 100, orange);
rose.Add(180, 200, orange);
gives this:
versionb.png
versionb.png (37.94 KiB) Viewed 7244 times
this is perplexing behavior.

a) what does the 100 & 200 do? 45 as width in degrees and 90 as start in degrees make sense. 100 or 200 for radius makes sense; but not the two different values.

b) i do not understand why adding another "slice" affects the first.

am i missing something obvious? is there any documentation that would help?

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Rose Series help

Post by Christopher » Mon Feb 16, 2015 12:47 pm

Hello,

This is a little confusing, I agree.

I have made some modifications to the source code so that this code:

Code: Select all

    private void InitializeChart()
    {
      tChart1.Aspect.ClipPoints = false;
      tChart1.Aspect.View3D = false;
      Rose rose = new Rose(tChart1.Chart);
      rose.Circled = true;

      rose.CloseCircle = false;

      rose.GetVertAxis.SetMinMax(0, 1000);

      rose.Add(14.4, 959.986);
      rose.Add(28.8, 137.34);
      rose.Add(43.2, 878.4);
   }
now gives this:
chart_part.PNG
chart_part.PNG (98.3 KiB) Viewed 7220 times
I think this should be enough to see what is happening here ... for each slice that is drawn, the position of the last slice is not possible to determine if the slices do not form a complete circle. This is because the slice is a polygon drawn from the first point to the second and so on.

If you think that this source change is sufficient, that with CloseCircle the Chart draws as shown, then I will mark it for production code.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply