How to use victory-axis - 2 common examples

To help you get started, we’ve selected a few victory-axis 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 hugohow / react-native-touchable-graph / src / VictoryAxisCustom.js View on Github external
import React from "react";
import { Dimensions } from "react-native";
import { G } from "react-native-svg";
import { VictoryAxis } from "victory-axis/es";
import { VictoryContainer, VictoryLabel, Axis  } from "victory-core/es";

class VictoryAxisCustom extends VictoryAxis {
	constructor(props){
		super(props);
	}
    static defaultProps = Object.assign({}, VictoryAxis.defaultProps, {
        axisComponent: <Axis/>,
        axisLabelComponent: <VictoryLabel/>,
        tickLabelComponent: <VictoryLabel/>,
        tickComponent: <Axis/>,
        gridComponent: <Axis/>,
        containerComponent: <VictoryContainer/>,
        groupComponent: <G/>,
        width: Dimensions.get("window").width
      });

      componentDidMount() {
          const baseProps = this.baseProps
          const axisData = Object.keys(baseProps).map(function(key, index) {
            return { tickLabels: baseProps[key].tickLabels, tickAxis: baseProps[key].axis }
          })
          this.props.getTickAxisDatum(axisData)
github FormidableLabs / victory-native / lib / components / victory-axis.js View on Github external
import React from "react";
import { Dimensions } from "react-native";
import { G } from "react-native-svg";
import { VictoryAxis } from "victory-axis/es";
import VictoryLabel from "./victory-label";
import VictoryContainer from "./victory-container";
import LineSegment from "./victory-primitives/line-segment";

export default class extends VictoryAxis {
  static defaultProps = Object.assign({}, VictoryAxis.defaultProps, {
    axisComponent: <LineSegment/>,
    axisLabelComponent: <VictoryLabel/>,
    tickLabelComponent: <VictoryLabel/>,
    tickComponent: <LineSegment/>,
    gridComponent: <LineSegment/>,
    containerComponent: <VictoryContainer/>,
    groupComponent: <G/>,
    width: Dimensions.get("window").width
  });
}

victory-axis

Axis Component for Victory

MIT
Latest version published 2 months ago

Package Health Score

98 / 100
Full package analysis

Popular victory-axis functions