當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript AmChartsService.makeChart方法代碼示例

本文整理匯總了TypeScript中@amcharts/amcharts3-angular.AmChartsService.makeChart方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript AmChartsService.makeChart方法的具體用法?TypeScript AmChartsService.makeChart怎麽用?TypeScript AmChartsService.makeChart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@amcharts/amcharts3-angular.AmChartsService的用法示例。


在下文中一共展示了AmChartsService.makeChart方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: ngOnInit

  ngOnInit() {
    // Create chartdiv1
    this.options = this.makeOptions(this.makeRandomDataProvider());

    // Create chartdiv2
    this.chart2 = this.AmCharts.makeChart('chartdiv2', this.makeOptions(this.makeRandomDataProvider()));

    this.timer = setInterval(() => {
      // Update chartdiv1
      this.options = this.makeOptions(this.makeRandomDataProvider());

      // Update chartdiv2
      this.AmCharts.updateChart(this.chart2, () => {
        this.chart2.dataProvider = this.makeRandomDataProvider();
      });
    }, 3000);
  }
開發者ID:amcharts,項目名稱:amcharts3-angular2,代碼行數:17,代碼來源:app.component.ts

示例2: ngOnInit

  ngOnInit() {
    this.chart = this.AmCharts.makeChart("chartdiv", {
    "type": "serial",
    "theme": "light",
    "legend": {
        // "useGraphSettings": true,
        "enabled": false
    },
    "dataProvider": [{
        "year": 1930,
        "italy": 1,
        "germany": 5,
        "uk": 3
    }, {
        "year": 1934,
        "italy": 1,
        "germany": 2,
        "uk": 6
    }, {
        "year": 1938,
        "italy": 2,
        "germany": 3,
        "uk": 1
    }, {
        "year": 1950,
        "italy": 3,
        "germany": 4,
        "uk": 1
    }, {
        "year": 1954,
        "italy": 5,
        "germany": 1,
        "uk": 2
    }, {
        "year": 1958,
        "italy": 3,
        "germany": 2,
        "uk": 1
    }, {
        "year": 1962,
        "italy": 1,
        "germany": 2,
        "uk": 3
    }, {
        "year": 1966,
        "italy": 2,
        "germany": 1,
        "uk": 5
    }, {
        "year": 1970,
        "italy": 3,
        "germany": 5,
        "uk": 2
    }, {
        "year": 1974,
        "italy": 4,
        "germany": 3,
        "uk": 6
    }, {
        "year": 1978,
        "italy": 1,
        "germany": 2,
        "uk": 4
    }],
    "valueAxes": [{
        "integersOnly": true,
        "maximum": 6,
        "minimum": 1,
        "axisAlpha": 0,
        "dashLength": 5,
        "gridCount": 10,
        "position": "left",
        "title": "Place taken"
    }],
    "listener":[],
    "startDuration": 0.5,
    "graphs": [{
        "balloonText": "place taken by Italy in [[category]]: [[value]]",
        "bullet": "round",
        "hidden": true,
        "title": "Italy",
        "valueField": "italy",
		"fillAlphas": 0
    }, {
        "balloonText": "place taken by Germany in [[category]]: [[value]]",
        "bullet": "round",
        "title": "Germany",
        "valueField": "germany",
		    "fillAlphas": 0
    }, {
        "balloonText": "place taken by UK in [[category]]: [[value]]",
        "bullet": "round",
        "title": "United Kingdom",
        "valueField": "uk",
		    "fillAlphas": 0
    }],
    "chartCursor": {
        "cursorAlpha": 0,
        "zoomable": false,
        "categoryBalloonEnabled":false
//.........這裏部分代碼省略.........
開發者ID:WV-no7,項目名稱:Angular-stuff,代碼行數:101,代碼來源:app.component.ts

示例3: ngOnInit

  ngOnInit() {
    this.chartData1 = new Object(this.commonChartPart());
    this.chartData1.graphs.push({
        "balloonText": "place taken by Italy in [[category]]: [[value]]",
        "bullet": "round",
        "hidden": true,
        "title": "Italy",
        "valueField": "italy",
		    "fillAlphas": 0
    }, {
        "balloonText": "place taken by Germany in [[category]]: [[value]]",
        "bullet": "round",
        "title": "Germany",
        "hidden": true,
        "valueField": "germany",
		    "fillAlphas": 0
    }, {
        "balloonText": "place taken by UK in [[category]]: [[value]]",
        "bullet": "round",
        // "type":"column",
        "title": "United Kingdom",
        "valueField": "uk",
		    "fillAlphas": 0.2
    })
    this.chartData1.marginTop=5;
    this.chartData1.marginBottom=0;
    debugger;

    this.chartData1.valueAxes.push({
        "integersOnly": true,
        "maximum": 6,
        "minimum": 1,
        "axisAlpha": 0,
        "fontSize": 10,
        "dashLength": 5,
        "gridCount": 10,
        "position": "left",
    })

    this.chartData1.categoryAxis = {
      "labelsEnabled":false,
    }


    this.chart = this.AmCharts.makeChart("chartdiv", this.chartData1);

    this.chartData2 = new Object(this.commonChartPart());
    this.chartData2.graphs.push({
        "balloonText": "place taken by Italy in [[category]]: [[value]]",
        "bullet": "round",
        "hidden": true,
        "title": "Italy",
        "valueField": "italy",
		    "fillAlphas": 0
    }, {
        "balloonText": "place taken by Germany in [[category]]: [[value]]",
        "bullet": "round",
        "title": "Germany",
        // "type": "column",
        "valueField": "germany",
		    "fillAlphas": 0.2
    }, {
        "balloonText": "place taken by UK in [[category]]: [[value]]",
        "bullet": "round",
        "title": "United Kingdom",
        "hidden": true,
        "valueField": "uk",
		    "fillAlphas": 0
    })

    this.chartData2.marginTop = -1
    this.chartData2.marginBottom = 4

    this.chartData2.valueAxes.push({
        "integersOnly": true,
        "maximum": 6,
        "minimum": 1,
        "reversed": true,
        "axisAlpha": 0,
        "fontSize": 10,
        "dashLength": 5,
        "gridCount": 10,
        "position": "left"
    })
    this.chartData2.categoryAxis = {
      "labelsEnabled":false,
      "position":"top"
    }


  this.chart2 = this.AmCharts.makeChart("chartdiv2", this.chartData2);
  }
開發者ID:WV-no7,項目名稱:Angular-stuff,代碼行數:92,代碼來源:app.component.ts


注:本文中的@amcharts/amcharts3-angular.AmChartsService.makeChart方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。