         timeSegmentControl?.addTarget(self, action: #selector(segmentControlClick(sender:)), for: UIControlEvents.valueChanged)
         graphView.addSubview(timeSegmentControl!)
         
+        lineChart.frame = CGRect.init(x: 30, y: 55, width: screenWidth - 60, height: 160)
+        graphView.addSubview(lineChart)
+        let weeks = ["1周", "2周", "3周", "4周", "5周", "6周"]
+        let unitsSold = [20.0, 4.0, 6.0, 3.0, 12.0, 16.0]
+        setChart(weeks, values: unitsSold)
+        
+        /*
         chartView = UIImageView.init(frame: CGRect.init(x: 30, y: 55, width: screenWidth - 60, height: 160))
         chartView?.image = UIImage.init(named: "chartWeek")
         graphView.addSubview(chartView!)
+        */
         
         scrollView.addSubview(graphView)
         

import UIKit
import Alamofire
import AlamofireImage

class MineViewController: UIViewController {
    

    func segmentControlClick(sender:UISegmentedControl){
        switch sender.selectedSegmentIndex {
        case 0:
            let weeks = ["1周", "2周", "3周", "4周", "5周", "6周"]
            let unitsSold = [20.0, 4.0, 6.0, 3.0, 12.0, 16.0]
            setChart(weeks, values: unitsSold)
        case 1:
            let months = ["7月", "8月", "9月", "10月", "11月", "12月"]
            let unitsSold = [100.0, 130.0, 80.0, 70.0, 160.0, 190.0]
            setChart(months, values: unitsSold)
        case 2:
            let years = ["2012", "2013", "2014", "2015", "2016", "2017"]
            let unitsSold = [0.0, 0.0, 0.0, 2000.0, 3120.0, 5160.0]
            setChart(years, values: unitsSold)
        default:
            let weeks = ["1周", "2周", "3周", "4周", "5周", "6周"]
            let unitsSold = [20.0, 4.0, 6.0, 3.0, 12.0, 16.0]
            setChart(weeks, values: unitsSold)
        }
    }
    
