I have created a chart with three bars and I'm displaying a number of grouped data into the three bars. Right now I'm able to show this graph:
Based on the documentations, scrolling in both directions is there by default however I am unable to scroll the data both vertically and horizontally. The chart is trying to fit everything on the frame.
Is there away to not let the chart fit all the data in the frame and just let it overflow horizontally and most importantly allow the user to scroll horizontally?
Please see my code:
Code: Select all
private void SetupChart ()
{
_chart = new TChart();
_chart.Header.Visible = false;
_chart.Frame = new CGRect(0, 0,
GraphContainer.Frame.Size.Width,
GraphContainer.Frame.Size.Height);
GraphContainer.AddSubview(_chart);
bar1 = new Bar();
bar1.Title = "Oranges";
bar1.Marks.Visible = false;
bar2 = new Bar();
bar2.Title = "Apples";
bar2.Marks.Visible = false;
bar3 = new Bar();
bar3.Title = "Grand Total";
bar3.Marks.Visible = false;
_chart.Series.Add(bar1);
_chart.Series.Add(bar2);
_chart.Series.Add(bar3);
_chart.Legend.CheckBoxes = true;
_chart.Axes.Left.Grid.Visible = false;
_chart.Legend.Alignment = LegendAlignments.Bottom;
_chart.Legend.MaxNumRows = 3;
_chart.Zoom.Active = true;
_chart.Panning.Allow = ScrollModes.None;
_chart.Zoom.Direction = ZoomDirections.Horizontal;
/ Add data
foreach(Data d in _datas)
{
_bar1.Add(d.Orange, d.VendorName);
_bar2.Add(d.Apple, d.VendorName);
_bar3.Add(d.Orange + d.Apple, d.VendorName);
}
}
Hope somebody can help or just point me to the right direction
Thanks!