diff --git a/demo/app.jsx b/demo/app.jsx
index 8321f9b..45bc812 100644
--- a/demo/app.jsx
+++ b/demo/app.jsx
@@ -5,6 +5,7 @@ import ReactDOM from "react-dom";
import {VictoryLine} from "../src/index";
import _ from "lodash";
import {VictoryLabel} from "victory-label";
+import d3Scale from "d3-scale";
class App extends React.Component {
constructor(props) {
@@ -48,38 +49,44 @@ class App extends React.Component {
return (
- Math.sin(2 * Math.PI * x)}
- labelComponent={{"label\ntwo"}}
- sample={25}
- />
+ Math.sin(2 * Math.PI * x)}
+ labelComponent={{"label\ntwo"}}
+ sample={25}
+ />
- x * x}
- />
+ x * x}
+ />
-
+
-
+
);
}
diff --git a/src/components/victory-line.jsx b/src/components/victory-line.jsx
index ca65828..f6cce83 100644
--- a/src/components/victory-line.jsx
+++ b/src/components/victory-line.jsx
@@ -271,7 +271,8 @@ export default class VictoryLine extends React.Component {
const step = _.max(domain) / samples;
// return an array of x values spaced across the domain,
// include the maximum of the domain
- return _.union(_.range(_.min(domain), _.max(domain), step), [_.max(domain)]);
+ const xArray = _.union(_.range(_.min(domain), _.max(domain), step), [_.max(domain)]);
+ return _.filter(xArray, (x) => x !== 0);
}
returnOrGenerateY(props, x) {