Page 1 of 1

Rendering issues on iPad

Posted: Wed Apr 11, 2012 7:03 pm
by 17262011
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 4203 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?

Re: Rendering issues on iPad

Posted: Tue Apr 17, 2012 10:33 am
by 10050769
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,