How to use the @swimlane/ngx-charts.formatLabel 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 usgs / earthquake-eventpages / src / app / shared / ngx-charts / bubble-chart / bubble-series / bubble-series.component.ts View on Github external
.map((d, i) => {
        if (typeof d.y === 'undefined' || typeof d.x === 'undefined') {
          return null;
        }

        const y = d.y;
        const x = d.x;
        const r = d.r;

        const radius = this.rScale(r || 1);
        const borderColor = d.borderColor || null;

        const tooltipLabel = Swimlane.formatLabel(d.name);

        const cx = this.xScale(x);
        const cy = this.yScale(y);

        const color = d.color ||
          this.colors.scaleType === 'linear'
            ? this.colors.getColor(r)
            : this.colors.getColor(seriesName);

        if (!d.opacity) {
          d.opacity = 1;
        }

        const opacity = isActive ? d.opacity : d.opacity / 3;

        // error bar calculations
github Hygieia / UI / src / app / shared / charts / combo-series-vertical / combo-series-vertical.component.ts View on Github external
this.bars = this.series.map((d, index) => {

      let value = d.value;
      const label = d.name;
      const formattedLabel = formatLabel(label);
      const roundEdges = this.type === 'standard';

      const bar: any = {
        value,
        label,
        roundEdges,
        data: d,
        width,
        formattedLabel,
        height: 0,
        x: 0,
        y: 0
      };

      if (this.type === 'standard') {
        bar.height = Math.abs(this.yScale(value) - this.yScale(0));