Rendering issues on iPad

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
toolbox
Newbie
Newbie
Posts: 12
Joined: Fri Mar 23, 2012 12:00 am

Rendering issues on iPad

Post by toolbox » Wed Apr 11, 2012 7:03 pm

I have an area chart, with dates on the x axis and decimal values on the y axis.

For some reason, the gridlines (and labels) are not spread evenly across the bottom axis. Is there a reason for this?
I noticed that in my data, the dates are not spread evenly, which may account for this. But notice the origin is overlapping, is there a way to fix this?

I'm attaching a screenshot for reference.
iOS Simulator Screen shot 2012-04-11 2.55.22 PM.png
iOS Simulator Screen shot 2012-04-11 2.55.22 PM.png (118.5 KiB) Viewed 4200 times
My code is very simple:

_chart = new TChart();

Common.ApplyChartTheme(_chart);

_chart.Header.Text = String.Empty;
_chart.Aspect.View3D = false;
_chart.Legend.Visible = true;
_chart.Legend.LegendStyle = LegendStyles.Series;
_chart.Legend.AutoSize = true;
_chart.Legend.Alignment = LegendAlignments.Top;
_chart.Legend.Shadow.Visible = false;
_chart.Legend.ResizeChart = true;
_chart.Legend.BevelWidth = 0;
_chart.Legend.Pen.Visible = false;
_chart.Legend.VertMargin = 5;

_chart.Axes.Left.Grid.Visible = false;

_chart.AutoresizingMask = UIViewAutoresizing.All;
_chart.Aspect.ZoomScrollStyle = Steema.TeeChart.Drawing.Aspect.ZoomScrollStyles.Manual;
_chart.Zoom.Allow = false;
_chart.Panning.Allow = ScrollModes.None;

_grossMarginLine = new Area(_chart.Chart);

_grossMarginLine.Title = "Gross Margin";

_grossMarginLine.ShowInLegend = true;

_grossMarginLine.Color = UIColor.FromRGB(6, 150, 37).CGColor;

_grossMarginLine.AreaLines.Color = UIColor.FromWhiteAlpha(1f, 0f).CGColor;

_grossMarginLine.LinePen.Color = UIColor.FromRGB(6, 150, 37).CGColor;

_grossMarginLine.Transparency = Common.ChartTransparency;

_grossMarginLine.Active = true;

_chart.Series.Add(_grossMarginLine);
_chart.AutoRepaint = false;

And in a loop I'm adding new elements to the series:
_grossMarginLine.Clear();
//_grossMarginLine.FillSampleValues(28);


foreach (var item in Report.Items)
{
_grossMarginLine.Add(item.Date, Convert.ToDouble(item.GrossMargin));
_grossMarginLine.DateTimeFormat = "MMM";
_grossMarginLine.Labels.Add(item.Date.ToString("MMM d"));
}

_grossMarginLine.Invalidate();

Any ideas?

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Rendering issues on iPad

Post by Sandra » Tue Apr 17, 2012 10:33 am

Hello toolbox,

Sorry for the delay. I suggest you change the Axes Labels Style property to value, as do in next code:

Code: Select all

tChart1.Axes.Bottom.Labels.Style = AxisLabelStyle.Value;
As you see the previous code is code c# for winforms but you should be able to do the same using MonoTouch code. Can you tell us if it solve your problem?

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply