How to use the victory.VictoryLine function in victory

To help you get started, we’ve selected a few victory 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 idyll-lang / idyll / examples / introduction / components / chart.js View on Github external
const React = require('react');
const IdyllComponent = require('idyll-component');
const V = require('victory');

const types = {
  LINE: V.VictoryLine,
  BAR: V.VictoryBar,
  SCATTER: V.VictoryScatter
};

class Chart extends IdyllComponent {
  render() {
    const INNER_CHART = types[this.props.type.toUpperCase()];
    return (
      <div>
        
          
          
        
      </div>
    );
  }
github maverick915 / southwest-price-drop-bot / lib / history-graph.js View on Github external
e(V.VictoryChart, {
      domainPadding: 20,
      padding: { top: 10, right: 50, bottom: 50, left: 50 },
      theme: Theme
    }, [
      e(V.VictoryAxis, {
        domainPadding: 0,
        tickFormat: date => dateFormat(new Date(date), 'm/d', true)
      }),
      e(V.VictoryAxis, {
        crossAxis: false,
        dependentAxis: true,
        domain: [ 0, maxPrice ],
        tickFormat: tick => '$' + tick
      }),
      e(V.VictoryLine, {
        data,
        x: 'time',
        y: 'price'
      }),
      e(V.VictoryLine, {
        data: [
          [ minTime, alert.price ],
          [ maxTime, alert.price ]
        ],
        label: 'Alert\nprice',
        style: {
          data: {
            stroke: 'indianred',
            strokeDasharray: '5,5'
          },
          labels: {
github idyll-lang / idyll / packages / idyll-cli / examples / scroll / components / chart.js View on Github external
const React = require('react');
const V = require('victory');

const types = {
  LINE: V.VictoryLine,
  BAR: V.VictoryBar,
  SCATTER: V.VictoryScatter
};

class Chart extends React.PureComponent {
  render() {
    const scale = 1 / (( this.props.randomSeed % 3  +  1));
    const INNER_CHART = types[this.props.type.toUpperCase()];
    const data = Array(100).fill().map((_) => {
      return {
        x: scale * Math.random(),
        y: scale * Math.random()
      }
    });

    return (
github idyll-lang / idyll / packages / idyll-components / src / chart.js View on Github external
import React from 'react';
const V = require('victory');
const d3Arr = require('d3-array');

const types = {
  AREA: V.VictoryArea,
  TIME: V.VictoryLine,
  LINE: V.VictoryLine,
  BAR: V.VictoryBar,
  SCATTER: V.VictoryScatter,
  PIE: V.VictoryPie
};

let chartCount = 0;

class Chart extends React.PureComponent {

  constructor(props) {
    super(props);
    this.id = chartCount++;
    this.state = {};
    this.renderError = this.renderError.bind(this);
    this.renderHelp = this.renderHelp.bind(this);
github mathisonian / hyperchart / components / chart.js View on Github external
const Victory = require('victory');
const Axis = require('victory').VictoryAxis;
const Chart = Victory.VictoryChart;

const chartMap = {
  line: Victory.VictoryLine,
  scatter: Victory.VictoryScatter
};

const getStyles = (props) => {
  switch (props.type) {
    case 'line':
      return {
        stroke: props.foregroundColor
      };
    case 'scatter':
      return {
        fill: props.foregroundColor
      };
  }
}
github idyll-lang / idyll / packages / idyll-components / src / chart.js View on Github external
import React from 'react';
const V = require('victory');
const d3Arr = require('d3-array');

const types = {
  AREA: V.VictoryArea,
  TIME: V.VictoryLine,
  LINE: V.VictoryLine,
  BAR: V.VictoryBar,
  SCATTER: V.VictoryScatter,
  PIE: V.VictoryPie
};

let chartCount = 0;

class Chart extends React.PureComponent {

  constructor(props) {
    super(props);
    this.id = chartCount++;
    this.state = {};
    this.renderError = this.renderError.bind(this);
    this.renderHelp = this.renderHelp.bind(this);
  }