簡體   English   中英

shinobi圖表中的堆積條形圖和折線圖

[英]Stacked bar chart and Line Chart in shinobi charts

我有一個報表圖表,在一個帶有一個X和Y軸的圖形上包含1個堆積的條形圖和3個折線圖。 我已經檢查了一些shinobi圖表控件,但是我無法找到創建這種圖表的方法。

PFA低於樣品用量

我已經檢查了多軸代碼,但它們似乎是兩個具有各自的交互和手勢的獨立圖表。 我希望所有這些都同時處理。

您在此處繪制的圖表不需要多軸功能。 相反,您有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;
    }
}

這會將所有系列與相同的軸相關聯,因此滾動和縮放將同時影響所有系列。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM