1.0.3 • Published 4 years ago

vue-gauge v1.0.3

Weekly downloads
121
License
ISC
Repository
github
Last release
4 years ago

VueJS Gauge Chart

A vuejs gauge charts wrap-over for the library gauge-chart .

Demo

Installation

npm install vue-gauge

Example

<template>
  <vue-gauge :refid="'type-unique-id'"></vue-gauge>
</template>

<script>
  import VueGauge from 'vue-gauge';
  export default {
    components: { VueGauge },
  }

</script>

Or to load as global component

<script>
  import VueGauge from 'vue-gauge';
  Vue.component('vue-gauge', VueGauge);
</script>

By default, the needle is pointing to 70, thus in order to move it you have to use like below

<template>
  <vue-gauge :refid="'type-unique-id'" :options="{'needleValue':85,'arcDelimiters':[85]}"></vue-gauge>
</template>

You can also change others gauge options value like:

<template>
  <vue-gauge :refid="'type-unique-id'" :options="{'needleValue':85,'arcDelimiters':[10,36,78], 'hasNeedle':false]}"></vue-gauge>
</template>

Options

NameValues RangesDescription
hasNeedletrue / falsedetermines whether to show the needle or not
needleColorvalue supported by CSScolorizes needle with specified colors
needleUpdateSpeednumber ⩾ 0determines the speed of needle update animation
arcColorsarray of values supported by CSScolorizes gauge with specified color
arcDelimitersarray of numbers from 0 to 100specifies delimiters of the gauge in ascending order
arcOverEffecttrue / falsedetermines if over effect on ars is enabled or not
arcLabelsarray of stringsspecifies labels to be placed at delimiters ends
arcPaddingnumberspecifies padding between arcs (in pixels)
arcPaddingColorvalue supported by CSScolor of the padding between delimeters
rangeLabelarray of two stringsdepicts gauge ranges on both sides of the chart
centralLabelstringdepicts gauge inner label
labelsFontstringspecifies font-family to be used for labels
chartWidthnumber larger than 0gives a width to the gauge (height is always 0.5 * chartWidth)
needleValuenumber from 0 to 100specifies needle value on the gauge

Examples

Some examples of what you can get out of the library using different properties:

Gauge Examples