我创建了一个包含20个系列的 func pageViewController(pageViewController: UIPageViewController, viewControllerBeforeViewController viewController: UIViewController) -> UIViewController? {
let currentDetailVC: RAFeedDetailViewController = viewController as! RAFeedDetailViewController
return vcAtIndex(currentDetailVC.index - 1)
}
func pageViewController(pageViewController: UIPageViewController, viewControllerAfterViewController viewController: UIViewController) -> UIViewController? {
let currentDetailVC: RAFeedDetailViewController = viewController as! RAFeedDetailViewController
return vcAtIndex(currentDetailVC.index + 1)
}
func vcAtIndex(index: Int) -> RAFeedDetailViewController? {
guard index < self.dataSourceItems.count - 1 && index >= 0 else { return nil }
/* insert logic here to get the correct view controller */
let detailVC: RAArticleDetailViewController = self.storyboard?.instantiateViewControllerWithIdentifier(String(RAArticleDetailViewController.self)) as! RAArticleDetailViewController
detailVC.index = index
return vc
}
图。每个OxyPlot
代表一个频道。原点现在位于左下角。
见下图:
我想让他们从上到下排序。如何在左上角设置OxyPlot原点?(见下图)
答案 0 :(得分:1)
我知道这是旧的,但您只需将Axis StartPosition设置为1,将EndPosition设置为0
CategoryAxis myAxis = new CategoryAxis();
myAxis.StartPosition = 1;
myAxis.EndPosition = 0;
答案 1 :(得分:0)
我最近发现Date
Oxyplot
配置适当Axis
StartPosition
get
和set
axis
的起始位置。
但是我没想到它是否会改变原点的方向。
我想出了一个不同的解决方案,我决定反向绘制它们并使用CategoryAxis
作为左轴并按降序设置标签。
plotModel.Axes.Add(new LinearAxis
{
Position = AxisPosition.Bottom,
MajorTickSize = 0,
MinorTickSize = 0
});
plotModel.Axes.Add(new CategoryAxis
{
Position = AxisPosition.Left,
Title = MyTitle,
MajorTickSize = 0,
MinorTickSize = 0,
LabelField = "LabelChannels",
Labels =
{ "20",
"19",
...
"3",
"2",
"1",
}
});
虽然知道是否还有其他任何方式,比我做的更简单,这将是一件好事。