Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run playgrounds? #4384

Closed
wodinga opened this issue Jun 4, 2020 · 2 comments
Closed

How to run playgrounds? #4384

wodinga opened this issue Jun 4, 2020 · 2 comments

Comments

@wodinga
Copy link

wodinga commented Jun 4, 2020

Sorry if this seems like a silly question, but I'm trying to run the MacOS playgrounds to understand how this works, but import Charts doesn't seem to do anything. I keep getting the following:

func generateLineData() -> LineChartData
                           ^~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:59:27: error: use of undeclared type 'BarChartData'
func generateBarData() -> BarChartData
                          ^~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:108:17: error: use of unresolved identifier 'CombinedChartView'
var chartView = CombinedChartView(frame: r)
                ^~~~~~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:113:40: error: use of unresolved identifier 'DrawOrder'
chartView.drawOrder                 = [DrawOrder.bar.rawValue, DrawOrder.bubble.rawValue, DrawOrder.candle.rawValue, DrawOrder.line.rawValue, DrawOrder.scatter.rawValue]
                                       ^~~~~~~~~

error: CombinedChart.xcplaygroundpage:113:64: error: use of unresolved identifier 'DrawOrder'
chartView.drawOrder                 = [DrawOrder.bar.rawValue, DrawOrder.bubble.rawValue, DrawOrder.candle.rawValue, DrawOrder.line.rawValue, DrawOrder.scatter.rawValue]
                                                               ^~~~~~~~~

error: CombinedChart.xcplaygroundpage:113:91: error: use of unresolved identifier 'DrawOrder'
chartView.drawOrder                 = [DrawOrder.bar.rawValue, DrawOrder.bubble.rawValue, DrawOrder.candle.rawValue, DrawOrder.line.rawValue, DrawOrder.scatter.rawValue]
                                                                                          ^~~~~~~~~

error: CombinedChart.xcplaygroundpage:113:118: error: use of unresolved identifier 'DrawOrder'
chartView.drawOrder                 = [DrawOrder.bar.rawValue, DrawOrder.bubble.rawValue, DrawOrder.candle.rawValue, DrawOrder.line.rawValue, DrawOrder.scatter.rawValue]
                                                                                                                     ^~~~~~~~~

error: CombinedChart.xcplaygroundpage:113:143: error: use of unresolved identifier 'DrawOrder'
chartView.drawOrder                 = [DrawOrder.bar.rawValue, DrawOrder.bubble.rawValue, DrawOrder.candle.rawValue, DrawOrder.line.rawValue, DrawOrder.scatter.rawValue]
                                                                                                                                              ^~~~~~~~~

error: CombinedChart.xcplaygroundpage:26:16: error: use of unresolved identifier 'CombinedChartData'
    let data = CombinedChartData()
               ^~~~~~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:36:20: error: use of unresolved identifier 'ChartDataEntry'
    var entries = [ChartDataEntry]()
                   ^~~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:39:24: error: use of unresolved identifier 'ChartDataEntry'
        entries.append(ChartDataEntry(x: Double(index) + 0.5, y: (Double(arc4random_uniform(15) + 5))))
                       ^~~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:42:15: error: use of unresolved identifier 'LineChartDataSet'
    let set = LineChartDataSet(values: entries, label: "Line DataSet")
              ^~~~~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:50:21: error: use of unresolved identifier 'NSUIFont'
    set.valueFont = NSUIFont.systemFont(ofSize: CGFloat(10.0))
                    ^~~~~~~~

error: CombinedChart.xcplaygroundpage:54:16: error: use of unresolved identifier 'LineChartData'
    let data = LineChartData()
               ^~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:62:21: error: use of unresolved identifier 'BarChartDataEntry'
    var entries1 = [BarChartDataEntry]()
                    ^~~~~~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:63:21: error: use of unresolved identifier 'BarChartDataEntry'
    var entries2 = [BarChartDataEntry]()
                    ^~~~~~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:67:25: error: use of unresolved identifier 'BarChartDataEntry'
        entries1.append(BarChartDataEntry(x: 0.0, y: (Double(arc4random_uniform(25) + 25))))
                        ^~~~~~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:71:25: error: use of unresolved identifier 'BarChartDataEntry'
        entries2.append(BarChartDataEntry(x: 0.0, yValues: [Double(arc4random_uniform(13) + 12), Double(arc4random_uniform(13) + 12)]))
                        ^~~~~~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:74:27: error: use of unresolved identifier 'BarChartDataSet'
    let set1            = BarChartDataSet(values: entries1, label: "Bar 1")
                          ^~~~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:77:27: error: use of unresolved identifier 'NSUIFont'
    set1.valueFont      = NSUIFont.systemFont(ofSize: CGFloat(10.0))
                          ^~~~~~~~

error: CombinedChart.xcplaygroundpage:80:27: error: use of unresolved identifier 'BarChartDataSet'
    let set2            = BarChartDataSet(values: entries2, label: "Bar 2")
                          ^~~~~~~~~~~~~~~

error: CombinedChart.xcplaygroundpage:84:27: error: use of unresolved identifier 'NSUIFont'
    set2.valueFont      = NSUIFont.systemFont(ofSize: CGFloat(10.0))
                          ^~~~~~~~

error: CombinedChart.xcplaygroundpage:95:16: error: use of unresolved identifier 'BarChartData'
    let data = BarChartData(dataSets: [set1, set2])
               ^~~~~~~~~~~~
@wodinga
Copy link
Author

wodinga commented Jun 4, 2020

Looks like downloading as a swift package misses the project files, which are required to build.

@wodinga wodinga closed this as completed Jun 4, 2020
@astubbs
Copy link

astubbs commented Jun 26, 2020

I have the same error, trying to run the playgrounds, having close the repository and open to directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants