File

src/app/modules/dashboard/services/renderer/renderer.service.ts

Description

Responsible to get chart data

Index

Methods

Constructor

constructor(lineChartService: LineChartService)

Default method of OrganisationService class

Parameters :
Name Type Optional
lineChartService LineChartService No

Methods

visualizer
visualizer(data: DashboardData, chartType: string)

Based on chart type call chart service

Currently, it supports only line chart

Parameters :
Name Type Optional Description
data DashboardData No

data

chartType string No

chart type

Returns : any
import { Injectable } from '@angular/core';
import { LineChartService } from './../chartjs';
import { DashboardData } from './../../interfaces';

/**
 * Responsible to get chart data
 */
@Injectable()

/**
 * @class RendererService
 */
export class RendererService {

  /**
 * Default method of OrganisationService class
   *
   * @param lineChartService
   */
  constructor(private lineChartService: LineChartService) { }

  /**
   * Based on chart type call chart service
   *
   * Currently, it supports only line chart
   *
   * @param {DashboardData} data data
   * @param {string}        chartType chart type
   */
  visualizer(data: DashboardData, chartType: string) {
    switch (chartType) {
      case 'line':
        return this.lineChartService.parseLineChart(data);
    }
  }
}

results matching ""

    No results matching ""