<div class="chart" data-percent="73">73%</div>
12816
def easy_as_pie percent, *args
      raise ArgumentError, "Must take a percent argument" unless percent
      pie_options = {:"data-percent" => percent, :class => 'chart'}
      
      options = args.extract_options!
      pie_options.merge!(options || {})

      label = args.first || "#{percent}%"

      content_tag :div, label, pie_options
    end
513356
def percent(self, value: float) -> 'Size':
        """"""
        raise_not_number(value)
        self.maximum = '{}%'.format(value)
        return self
452168
function(percentage) {
					var min = (this.options.min === 0) ? 0 : Math.log(this.options.min);
					var max = Math.log(this.options.max);
					var value = Math.exp(min + (max - min) * percentage / 100);
					value = this.options.min + Math.round((value - this.options.min) / this.options.step) * this.options.step;
					/* Rounding to the nearest step could exceed the min or
					 * max, so clip to those values. */
					if (value < this.options.min) {
						return this.options.min;
					} else if (value > this.options.max) {
						return this.options.max;
					} else {
						return value;
					}
				}
444524
def pos_by_percent(self, x_percent, y_percent):
        
        x = round(x_percent * self.width)
        y = round(y_percent * self.height)
        return int(x), int(y)
993539
function () {
            var axis = this,
              chart = axis.chart;

            axis.hasVisibleSeries = false;

            // Reset properties in case we're redrawing (#3353)
            axis.dataMin = axis.dataMax = axis.ignoreMinPadding = axis.ignoreMaxPadding = null;

            if (axis.buildStacks) {
                axis.buildStacks();
            }

            // loop through this axis' series
            each(axis.series, function (series) {

                if (series.visible || !chart.options.chart.ignoreHiddenSeries) {

                    var seriesOptions = series.options,
                      xData,
                      threshold = seriesOptions.threshold,
                      seriesDataMin,
                      seriesDataMax;

                    axis.hasVisibleSeries = true;

                    // Validate threshold in logarithmic axes
                    if (axis.isLog && threshold <= 0) {
                        threshold = null;
                    }

                    // Get dataMin and dataMax for X axes
                    if (axis.isXAxis) {
                        xData = series.xData;
                        if (xData.length) {
                            axis.dataMin = mathMin(pick(axis.dataMin, xData[0]), arrayMin(xData));
                            axis.dataMax = mathMax(pick(axis.dataMax, xData[0]), arrayMax(xData));
                        }

                        // Get dataMin and dataMax for Y axes, as well as handle stacking and processed data
                    } else {

                        // Get this particular series extremes
                        series.getExtremes();
                        seriesDataMax = series.dataMax;
                        seriesDataMin = series.dataMin;

                        // Get the dataMin and dataMax so far. If percentage is used, the min and max are
                        // always 0 and 100. If seriesDataMin and seriesDataMax is null, then series
                        // doesn't have active y data, we continue with nulls
                        if (defined(seriesDataMin) && defined(seriesDataMax)) {
                            axis.dataMin = mathMin(pick(axis.dataMin, seriesDataMin), seriesDataMin);
                            axis.dataMax = mathMax(pick(axis.dataMax, seriesDataMax), seriesDataMax);
                        }

                        // Adjust to threshold
                        if (defined(threshold)) {
                            if (axis.dataMin >= threshold) {
                                axis.dataMin = threshold;
                                axis.ignoreMinPadding = true;
                            } else if (axis.dataMax < threshold) {
                                axis.dataMax = threshold;
                                axis.ignoreMaxPadding = true;
                            }
                        }
                    }
                }
            });
        }
1204806
def _print_percent(self):
        ''''''
        fraction_done = ((self.continue_value or 0 + self.current_value) /
                         self.max_value)

        self._print('{fraction_done:.1%}'.format(fraction_done=fraction_done))
314675
function (d, chart, series) {
            var returnCy = 0;
            if (series.y.measure !== null && series.y.measure !== undefined) {
                returnCy = series.y._scale(d.cy);
            } else if (series.y.categoryFields !== null && series.y.categoryFields !== undefined && series.y.categoryFields.length >= 2) {
                returnCy = (series.y._scale(d.cy) - (chart._heightPixels() / series.y._max)) +  dimple._helpers.yGap(chart, series) + ((d.yOffset + 0.5) * (((chart._heightPixels() / series.y._max) - 2 * dimple._helpers.yGap(chart, series)) * d.height));
            } else {
                returnCy = series.y._scale(d.cy) - ((chart._heightPixels() / series.y._max) / 2);
            }
            return returnCy;
        }
549189
function setByPercentage(callback) {
    var percentage = 0;
    
    var setByPercentageInterval = setInterval(function() {
        if (percentage <= 100) {
            dothat.barGraph.setByPercentage(percentage);
            
            percentage++;
        } else {
            clearInterval(setByPercentageInterval);
            
            if (callback) {
                callback();
            }
        }
    }, 50);
}
188828
def make_vertical_bar(percentage, width=1):
    
    bar = ' _▁▂▃▄▅▆▇█'
    percentage //= 10
    percentage = int(percentage)
    if percentage < 0:
        output = bar[0]
    elif percentage >= len(bar):
        output = bar[-1]
    else:
        output = bar[percentage]
    return output * width
1060753
function ( el, percent ) {
        if ( $B.ua.DOC_MODE_IE9_LT ) {
            this.opacity = function ( el, percent ) {
                //setter
                if ( percent || percent == 0 ) {
                    percent = Number(percent);
                    //el.style.opacity = percent;

                    var ralpha = /alpha\([^)]*\)/i,
                        style = el.style,
                        cStyle = el.currentStyle,
                        opacity = ( typeof percent === 'number' )? 'alpha(opacity=' + (percent * 100) + ')' : '',
                        filter = cStyle && cStyle.filter || style.filter || '', css = '';

                    //style.zoom = 1;
                    if ( percent >= 1 && $B.string.trim( filter.replace( ralpha, '' ) ) === '' ) {
                        style.removeAttribute( 'filter' );
                        if ( cStyle && !cStyle.filter ) return;
                    }

                    //style.filter = ralpha.test( filter )? filter.replace( ralpha, opacity ) : filter + ' ' + opacity;
                    css = ralpha.test( filter )? filter.replace( ralpha, opacity ) : filter + ' ' + opacity;
                    $B.style.inline( el, 'zoom: 1; filter:' + css );

                    //getter
                } else {
                    var ropacity = /opacity\s*=\s*([^)]*)/;
                    return ropacity.test( (el.currentStyle ? el.currentStyle.filter : el.style.filter) || '' ) ?
                    0.01 * parseFloat( RegExp.$1 ) : 1;
                }
            };
        } else {
            this.opacity = function ( el, percent ) {
                //setter
                if ( percent || percent == 0 ) {
                    el.style.opacity = percent;
                    //getter
                } else {
                    return $B.style.current( el, 'opacity' );
                }
            };
        }

        return this.opacity( el, percent );
    }
315348
def global_unlock_percent(self):
        
        percent = CRef.cfloat()
        result = self._iface.get_ach_progress(self.name, percent)

        if not result:
            return 0.0

        return float(percent)
1374954
private function myPlot(
        string $chart_title,
        array $x_axis,
        string $x_axis_title,
        array $ydata,
        string $y_axis_title,
        array $z_axis,
        int $y_axis_type
    ): string {
        if (!count($ydata)) {
            return I18N::translate('This information is not available.');
        }

        // Colors for z-axis
        $colors = [];
        $index  = 0;
        while (count($colors) < count($ydata)) {
            $colors[] = self::Z_AXIS_COLORS[$index];
            $index    = ($index + 1) % count(self::Z_AXIS_COLORS);
        }

        // Convert our sparse dataset into a fixed-size array
        $tmp = [];
        foreach (array_keys($z_axis) as $z) {
            foreach (array_keys($x_axis) as $x) {
                $tmp[$z][$x] = $ydata[$z][$x] ?? 0;
            }
        }
        $ydata = $tmp;

        // Convert the chart data to percentage
        if ($y_axis_type === self::Y_AXIS_PERCENT) {
            // Normalise each (non-zero!) set of data to total 100%
            array_walk($ydata, static function (array &$x) {
                $sum = array_sum($x);
                if ($sum > 0) {
                    $x = array_map(static function ($y) use ($sum) {
                        return $y * 100.0 / $sum;
                    }, $x);
                }
            });
        }

        $data = [
            array_merge(
                [ I18N::translate('Century') ],
                array_values($z_axis)
            )
        ];

        $intermediate = [];
        foreach ($ydata as $century => $months) {
            foreach ($months as $month => $value) {
                $intermediate[$month][] = [
                    'v' => $value,
                    'f' => ($y_axis_type === self::Y_AXIS_PERCENT) ? sprintf('%.1f%%', $value) : $value,
                ];
            }
        }

        foreach ($intermediate as $key => $values) {
            $data[] = array_merge(
                [ $x_axis[$key] ],
                $values
            );
        }

        $chart_options = [
            'title' => '',
            'subtitle' => '',
            'height' => 400,
            'width'  => '100%',
            'legend' => [
                'position'  => count($z_axis) > 1 ? 'right' : 'none',
                'alignment' => 'center',
            ],
            'tooltip' => [
                'format' => '\'%\'',
            ],
            'vAxis' => [
                'title' => $y_axis_title ?? '',
            ],
            'hAxis' => [
                'title' => $x_axis_title ?? '',
            ],
            'colors' => $colors,
        ];

        return view(
            'statistics/other/charts/custom',
            [
                'data'          => $data,
                'chart_options' => $chart_options,
                'chart_title'   => $chart_title,
            ]
        );
    }
941805
function (d, chart, series) {
            var returnXClusterGap = 0;
            if (series.x.categoryFields !== null && series.x.categoryFields !== undefined && series.x.categoryFields.length >= 2 && series.clusterBarGap > 0 && !series.x._hasMeasure()) {
                returnXClusterGap = (d.width * ((chart._widthPixels() / series.x._max) - (dimple._helpers.xGap(chart, series) * 2)) * (series.clusterBarGap > 0.99 ? 0.99 : series.clusterBarGap)) / 2;
            }
            return returnXClusterGap;
        }
505403
def percentage(value, digits=2):
    '''
    

    '''

    value = float(value) * 100.0
    return u'' + '%s %%' % (_format(value, digits),)
856046
private int percent(final long val, final long total) {
        if (total == 0) {
            return 100;
        }

        if (val == 0) {
            return 0;
        }

        double dVal = (double) val;
        double dTotal = (double) total;

        return (int) (dVal / dTotal * 100);
    }
1011321
public void setPercent(double percent) {

        if (percent > 100) {
            percent = 100;
        }

        if (percent < 0) {
            percent = 0;
        }

        this.percent = percent;
        fillContainer.getElement().getStyle().setWidth(percent, Unit.PCT);
    }
1006231
function (d, chart, series) {
            var returnYClusterGap = 0;
            if (series.y.categoryFields !== null && series.y.categoryFields !== undefined && series.y.categoryFields.length >= 2 && series.clusterBarGap > 0 && !series.y._hasMeasure()) {
                returnYClusterGap = (d.height * ((chart._heightPixels() / series.y._max) - (dimple._helpers.yGap(chart, series) * 2)) * (series.clusterBarGap > 0.99 ? 0.99 : series.clusterBarGap)) / 2;
            }
            return returnYClusterGap;
        }