0.2.7 • Published 4 years ago

vue-depth-chart v0.2.7

Weekly downloads
76
License
-
Repository
github
Last release
4 years ago

Vue-Depth-Chart

image

Configurable Depth Chart component based on Vue

English | 简体中文 | Article

  • 日间模式

image

  • 夜间模式

image

Installation

You can install and save an entry to your package.json with the following command:

npm i vue - depth - chart

Usage

Globally reference `vue-depth-chart` ` ` in ` ` `main.js`, you can use it directly in any component (note that the corresponding css should be introduced in the component)

  • main.js
import Vue from 'vue'
import App from './App.vue'

import "vue-depth-chart"

Vue.config.productionTip = false

new Vue({
    render: h => h(App),
}).$mount('#app')
  • App.vue
<template>
  <div id="app">
    <vue-depth-chart :data="data" :customizeOptions="options" :theme="theme" />
  </div>
</template>

<script>

export default {
  name: "App",
  data() {
    return {
      options: {
        width: 780,
        height: 540,
      },
      theme: "day",
      data: {
        buy: [
          { price: 10977.76, amount: 0.303 },
          { price: 10977.63, amount: 0.462 },
          ...more items
        ],
        sell: [
          { price: 10986, amount: 52.896 },
          { price: 10985.91, amount: 48.57 },
          ...more items
        ],
      },
    };
  },
};
</script>
<style scoped>
@import "~vue-depth-chart/dist/vue-depth-chart.css";
</style>

Config Options

  • Basic configuration
OptionsDescriptionDay modeNight mode
widthViewable width of depth map`780` ` ` | ` ` `780`
heightVisual height of depth map`540` ` ` | ` ` `540`
initOffsetInitial offset, to solve line blur`0.5` ` ` | ` ` `0.5`
bgColorOverall background color`rgba(255,255,255,0.1)` ` ` | ` ` `rgba(0,0,0,0.9)`
  • Watermark configuration
OptionsDescriptionDay modeNight mode
watermaskTypeWatermark type, optional `text` ` `(text) ` ` `image` ` `(picture) | ` ` `image` ` ` | ` ` `image`
watermaskContentWatermark content, when `watermaskType` ` `=` ` `text` ` `, it should be a specific text string, when ` ` `watermaskType` ` `=` ` `image` ` `, it should be Is the corresponding image base64 string | ` ` `data:image/png;base64,..` ` ` | ` ` `data:image/png;base64,..`
  • Line configuration
OptionsDescriptionDay modeNight mode
gridLineColorGrid line color`#ddd` ` ` | ` ` `#333`
rulerLineColorRuler line color color`#999` ` ` | ` ` `rgb(47,47,47)`
  • Shaft configuration
OptionsDescriptionDay modeNight mode
xAxisGridSpacex-axis background grid spacing`90` ` ` | ` ` `90`
yAxisGridSpacey-axis background grid spacing`30` ` ` | ` ` `30`
xAxisFontColorx-axis ruler scale font color`#666` ` ` | ` ` `#999`
yAxisFontColory-axis ruler scale font color`#666` ` ` | ` ` `#999`
xAxisFontSizex-axis ruler scale font size`12px Aria` ` ` | ` ` `12px Aria`
yAxisFontSizey-axis ruler scale font size`12px` ` ` | ` ` `12px Aria`
yAxisShadowColory-axis ruler scale shadow color`#fff` ` ` | ` ` `#333`
  • Pitch configuration
OptionsDescriptionDay modeNight mode
bottomSpaceThe distance between the depth map and the y-axis`8` ` ` | ` ` `8`
buySellSpaceEnd-point spacing of buy and sell orders`10` ` ` | ` ` `10`
  • Basic configuration of prompt box
OptionsDescriptionDay modeNight mode
tipWidthTip width`120` ` ` | ` ` `120`
tipHeightTip height`60` ` ` | ` ` `60`
tipLocationLineColorTip Location Line Color`#999` ` ` | ` ` `#999`
tipLocationDotRadiusTip Location Dot Radius`5` ` ` | ` ` `5`
tipTypeThe type of the tip type of the mouse movement, `axis` ` ` (on the xy axis) ` ` `mouse` ` ` (absolute positioning display following the mouse position) | ` ` `mouse` ` ` | ` ` `mouse`
  • Prompt box (sale) configuration
OptionsDescriptionDay modeNight mode
tipBuyLocationDotBgColorThe background color of the dots of the pay prompt box`#fff` ` ` | ` ` `#fff`
tipBuyBorderColorBorder color of the tipBuy box`#67c23a` ` ` | ` ` `#67c23a`
tipBuyBgColorBackground color of the prompt box to pay`#f0f9eb` ` ` | ` ` `#f0f9eb`
tipBuyTextColorPrompt text color of the buy order prompt box`#67c23a` ` ` | ` ` `#67c23a`
tipSellLocationDotBgColorDot background color of the sell order prompt box`#fff` ` ` | ` ` `#fff`
tipSellBorderColorBorder color of the sell order tip box`#f56c6c` ` ` | ` ` `#f56c6c`
tipSellBgColorSell order prompt box background color`#fef0f0` ` ` | ` ` `#fef0f0`
tipSellTextColorTips text color of the sell order prompt box`#f56c6c` ` ` | ` ` `#f56c6c`
  • Buy and sell strokes and fill configuration
OptionsDescriptionDay modeNight mode
buyStrokeColorBuy Stroke Color`rgb(111,168,0)` ` ` | ` ` `rgb(111,168,0)`
sellStrokeColorSell Stroke Color`rgb(234,0,112)` ` ` | ` ` `rgb(234,0,112)`
buyLinearGradientArraybuy order fill gradient array (top to bottom)`["rgb(141,186,51)", "rgb(160,197,87)", "rgb(189,215,138)", "rgb(228,238,206)", " rgb(250,250,241)"]` ` ` | ` ` `["rgb(80,120,3)", "rgb(72,106,4)", "rgb(51,74,5)", "rgb(35,49, 7)", "rgb(20,25,8)"]`
sellLinearGradientArraySell order fill gradient array (top to bottom)`["rgb(255,148,152)", "rgb(255,164,172)", "rgb(255,192,197)", "rgb(255,228,230)", "rgb(255,249,249) "]` ` ` | ` ` `["rgb(217,45,127)", "rgb(172,37,101)", "rgb(115,27,68)", "rgb(64,19,39)", "rgb(26,13,18)"]`
0.2.7

4 years ago

0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.2.2

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago