Page 1 of 1
Rose Series help
Posted: Thu Feb 12, 2015 12:45 pm
by 18270926
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.
Re: Rose Series help
Posted: Fri Feb 13, 2015 12:26 pm
by Christopher
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);
Re: Rose Series help
Posted: Fri Feb 13, 2015 8:34 pm
by 18270926
Code: Select all
rose.Add(45, 100, green);
rose.Add(90, 200, green);
gives this:
- versiona.png (38.23 KiB) Viewed 7282 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 (37.94 KiB) Viewed 7276 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?
Re: Rose Series help
Posted: Mon Feb 16, 2015 12:47 pm
by Christopher
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 (98.3 KiB) Viewed 7252 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.