ios - shinobi 图表中的堆叠条形图和折线图

标签 ios iphone graph shinobi

我有一个报表图表,其中包含 1 个堆叠条形图和 3 个折线图,位于具有一个 X 轴和 Y 轴的单个图形上。我检查了一些 shinobi 图表控件,但我想不出创建此类图表的方法。

PFA below a sample descprition

我已经检查了多轴代码,但它们似乎是两个独立的图表,具有自己的交互和手势。我希望同时处理所有这些问题。

最佳答案

您在那里绘制的图表不需要多轴功能。相反,您有 4 个不同的系列 - 在 2 个堆叠组中。以下代码示例演示了如何使用 SChartDatasource 方法执行此操作:

- (SChartSeries*)sChart:(ShinobiChart *)chart seriesAtIndex:(NSInteger)index {
    if(index == 3) {
        // Index 3 will be the line series
        SChartLineSeries* lineSeries = [[SChartLineSeries alloc] init];
        // Put it in the stack group indexed by the number 0
        lineSeries.stackIndex = @0;
        return lineSeries;
    } else { // index = 0, 1, 2
        // The other indices represent the columns
        SChartColumnSeries *columnSeries = [SChartColumnSeries new];
        // Put them all in the same stack group (indexed by the number 1)
        columnSeries.stackIndex = @1;
        return columnSeries;
    }
}

这会将所有系列与相同的轴相关联,因此滚动和缩放将同时影响所有系列。

关于ios - shinobi 图表中的堆叠条形图和折线图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21037235/

相关文章:

iphone - 我的页面在 PC 或 Mac 上加载正常,但在装有 iOS 5.1.1 的 iPad 或 iPhone 上完全消失

iphone - 如何确定 ViewController 是否是顶级的?

algorithm - 如果形成循环的一条边已知,则列出图中形成循环的所有边的最快方法

ios - 没有父级的 UIWebView loadRequest

ios - Touches 在 TableView 上结束

iphone - 如何将 3d View 旋转 360 度?

database - Cypher - 如何处理否定?

swift - 如何使用 ios 图表创建面积图?

iphone - 应用程序本身的应用程序名称

javascript - iOS 上的 JS 文件/库返回 HTTP 500