-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from KarthikRIyer/bar_chart
Implement horizontal and stacked bar chart
- Loading branch information
Showing
31 changed files
with
585 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import SwiftPlot | ||
import AGGRenderer | ||
import SVGRenderer | ||
|
||
var filePath = "examples/Reference/" | ||
let fileName = "_18_bar_chart_horizontal_stacked" | ||
|
||
let x:[String] = ["2008","2009","2010","2011"] | ||
let y:[Float] = [320,-100,420,500] | ||
let y1:[Float] = [100,100,220,245] | ||
|
||
var agg_renderer: AGGRenderer = AGGRenderer() | ||
var svg_renderer: SVGRenderer = SVGRenderer() | ||
|
||
var plotTitle: PlotTitle = PlotTitle() | ||
|
||
var barGraph: BarGraph = BarGraph() | ||
barGraph.addSeries(x, y, label: "Plot 1", color: .orange, graphOrientation: .horizontal) | ||
barGraph.addStackSeries(y1, label: "Plot 2", color: .blue) | ||
plotTitle.title = "BAR CHART" | ||
barGraph.plotTitle = plotTitle | ||
|
||
barGraph.drawGraphAndOutput(fileName: filePath+"agg/"+fileName, renderer: agg_renderer) | ||
barGraph.drawGraphAndOutput(fileName: filePath+"svg/"+fileName, renderer: svg_renderer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import SwiftPlot | ||
import AGGRenderer | ||
import SVGRenderer | ||
|
||
var filePath = "examples/Reference/" | ||
let fileName = "_08_bar_chart" | ||
|
||
let x:[String] = ["2008","2009","2010","2011"] | ||
let y:[Float] = [320,-100,420,500] | ||
|
||
var agg_renderer: AGGRenderer = AGGRenderer() | ||
var svg_renderer: SVGRenderer = SVGRenderer() | ||
|
||
var plotTitle: PlotTitle = PlotTitle() | ||
|
||
var barGraph: BarGraph = BarGraph() | ||
barGraph.addSeries(x, y, label: "Plot 1", color: .orange, graphOrientation: .horizontal) | ||
plotTitle.title = "BAR CHART" | ||
barGraph.plotTitle = plotTitle | ||
|
||
barGraph.drawGraphAndOutput(fileName: filePath+"agg/"+fileName, renderer: agg_renderer) | ||
barGraph.drawGraphAndOutput(fileName: filePath+"svg/"+fileName, renderer: svg_renderer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import SwiftPlot | ||
import AGGRenderer | ||
import SVGRenderer | ||
|
||
var filePath = "examples/Reference/" | ||
let fileName = "_17_bar_chart_vertical_stacked" | ||
|
||
let x:[String] = ["2008","2009","2010","2011"] | ||
let y:[Float] = [320,-100,420,500] | ||
let y1:[Float] = [100,100,220,245] | ||
|
||
var agg_renderer: AGGRenderer = AGGRenderer() | ||
var svg_renderer: SVGRenderer = SVGRenderer() | ||
|
||
var plotTitle: PlotTitle = PlotTitle() | ||
|
||
var barGraph: BarGraph = BarGraph() | ||
barGraph.addSeries(x, y, label: "Plot 1", color: .orange) | ||
barGraph.addStackSeries(y1, label: "Plot 2", color: .blue) | ||
plotTitle.title = "BAR CHART" | ||
barGraph.plotTitle = plotTitle | ||
|
||
barGraph.drawGraphAndOutput(fileName: filePath+"agg/"+fileName, renderer: agg_renderer) | ||
barGraph.drawGraphAndOutput(fileName: filePath+"svg/"+fileName, renderer: svg_renderer) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+536 Bytes
(100%)
examples/Reference/agg/_09_bar_chart_forward_slash_hatched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+561 Bytes
(100%)
examples/Reference/agg/_10_bar_chart_backward_slash_hatched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+551 Bytes
(100%)
examples/Reference/agg/_11_bar_chart_vertical_hatched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+195 Bytes
(100%)
examples/Reference/agg/_12_bar_chart_horizontal_hatched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+552 Bytes
(100%)
examples/Reference/agg/_15_bar_chart_hollow_circle_hatched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+533 Bytes
(100%)
examples/Reference/agg/_16_bar_chart_filled_circle_hatched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.