How to use the @swimlane/ngx-charts/release/utils.colorSets.find function in @swimlane/ngx-charts

To help you get started, we’ve selected a few @swimlane/ngx-charts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BinaryStudioAcademy / bsa-2018-watcher / frontend / src / app / dashboards / charts / models / chart-options.ts View on Github external
import {colorSets} from '@swimlane/ngx-charts/release/utils';
import * as shape from 'd3-shape';
import {DashboardChart} from '../../models/dashboard-chart';
import {dashboardChartTypes} from './dashboardChartTypes';

export const defaultOptions = {
  view: [716, 337],
  id: 0,
  showCommon: true,
  threshold: 0,
  mostLoaded: 1,
  // colorScheme:  {
  //   domain: ['#5AA454', '#A10A28', '#C7B42C', '#AAAAAA']
  // },
  colorScheme: {...colorSets.find(s => s.name === 'cool')},
  schemeType: 'ordinal',
  showLegend: true,
  legendTitle: 'Legend',
  gradient: false,
  showXAxis: true,
  showYAxis: true,
  showXAxisLabel: true,
  showYAxisLabel: true,
  yAxisLabel: '',
  xAxisLabel: '',
  yScaleMax: 100,
  yScaleMin: 0,
  autoScale: true,
  showGridLines: true,
  rangeFillOpacity: 0.5,
  roundDomains: false,
github BinaryStudioAcademy / bsa-2018-watcher / frontend / src / app / core / services / data.service.ts View on Github external
instantiateDashboardChartFromRequest(value: ChartRequest, chartId: number): DashboardChart {
    const chart: Chart = {
      id: chartId,
      ...value,
      scheme: {...colorSets.find(s => s.name === value.schemeType)}
    };

    return this.instantiateDashboardChart(chart);
  }
github BinaryStudioAcademy / bsa-2018-watcher / frontend / src / app / core / services / data.service.ts View on Github external
instantiateDashboardChartFromRequest(value: ChartRequest, chartId: number): DashboardChart {
    const chart: Chart = {
      id: chartId,
      ...value,
      scheme: {...colorSets.find(s => s.name === value.schemeType)}
    };

    return this.instantiateDashboardChart(chart);
  }
github BinaryStudioAcademy / bsa-2018-watcher / frontend / src / app / core / services / data.service.ts View on Github external
instantiateDashboardChart(value: Chart): DashboardChart {
    const dataProps = this.convertStringToArrEnum(value.sources);
    const dashChart: DashboardChart = {
      view: [600, 300],
      id: value.id,
      showCommon: value.showCommon,
      threshold: value.threshold,
      mostLoaded: value.mostLoaded,
      colorScheme: {...colorSets.find(s => s.name === value.schemeType)},
      schemeType: defaultOptions.schemeType,
      showLegend: value.showLegend,
      legendTitle: value.legendTitle,
      gradient: value.gradient,
      showXAxis: value.showXAxis,
      showYAxis: value.showYAxis,
      showXAxisLabel: value.showXAxisLabel,
      showYAxisLabel: value.showYAxisLabel,
      yAxisLabel: value.yAxisLabel,
      xAxisLabel: value.xAxisLabel,
      yScaleMin: defaultOptions.yScaleMin,
      yScaleMax: defaultOptions.yScaleMax,
      autoScale: value.autoScale,
      showGridLines: value.showGridLines,
      rangeFillOpacity: value.rangeFillOpacity,
      roundDomains: value.roundDomains,
github BinaryStudioAcademy / bsa-2018-watcher / frontend / src / app / core / services / data.service.ts View on Github external
instantiateDashboardChart(value: Chart): DashboardChart {
    const dataProps = this.convertStringToArrEnum(value.sources);
    const dashChart: DashboardChart = {
      view: [600, 300],
      id: value.id,
      showCommon: value.showCommon,
      threshold: value.threshold,
      mostLoaded: value.mostLoaded,
      historyTime: value.historyTime,
      colorScheme: {...colorSets.find(s => s.name === value.schemeType)},
      schemeType: defaultOptions.schemeType,
      showLegend: value.showLegend,
      legendTitle: value.legendTitle,
      gradient: value.gradient,
      showXAxis: value.showXAxis,
      showYAxis: value.showYAxis,
      showXAxisLabel: value.showXAxisLabel,
      showYAxisLabel: value.showYAxisLabel,
      yAxisLabel: value.yAxisLabel,
      xAxisLabel: value.xAxisLabel,
      yScaleMin: defaultOptions.yScaleMin,
      yScaleMax: defaultOptions.yScaleMax,
      autoScale: value.autoScale,
      showGridLines: value.showGridLines,
      rangeFillOpacity: value.rangeFillOpacity,
      roundDomains: value.roundDomains,