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?
Rendering issues on iPad
Re: Rendering issues on iPad
Hello toolbox,
Sorry for the delay. I suggest you change the Axes Labels Style property to value, as do in next code:
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,
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;
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 |
Instructions - How to post in this forum |