Rendering issues on iPad
Posted: 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. 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?
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. 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?