Skip to content

Commit

Permalink
fix: line chart demo render error
Browse files Browse the repository at this point in the history
  • Loading branch information
El-Chiang committed Oct 19, 2021
1 parent bf4665b commit 4f2a3b5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/f2-next/src/components/line/withLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export default View => {
}

render() {
const { chart, props } = this;
const { coord } = chart;
const { props } = this;
const { smooth, lineWidth } = props;
const { coord } = props;
const mapped = this.mapping();
const mappedArray = this.parsePoints(mapped);
return (
Expand Down
3 changes: 1 addition & 2 deletions packages/f2-next/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const Theme = {
line: [ 'line', 'dash' ],
point: [ 'circle', 'hollowCircle' ]
},
sizes: [ 2, 4, 6, 8 ],
sizes: [ 4, 8, 10, 12 ],
shape: {
line: {
lineWidth: 2,
Expand All @@ -117,4 +117,3 @@ const Theme = {
};

export default Theme;

2 changes: 1 addition & 1 deletion packages/f2-next/test/components/line.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { jsx } from '../../lib/jsx';
import { Canvas, Chart } from '../../src';
import { Line, Axis } from '../../src/components';
import { Rect, Polar } from '../../src/coord';
import { createContext } from "./util";
import { createContext } from "../util";

const colorCallback = jest.fn();

Expand Down
6 changes: 5 additions & 1 deletion packages/f2-next/test/components/line/line.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { jsx } from '../../../src';
import { Rect } from '../../../src/coord';
import { Canvas, Chart } from '../../../src';
import { Line, Point, Axis, Tooltip } from '../../../src/components';
import { createContext } from '../util';
import { createContext } from '../../util';

const data = [{
date: '2017-06-05',
Expand Down Expand Up @@ -293,6 +293,10 @@ describe('折线图', () => {
coord={{
type: Rect,
}}
theme={{
colors: ['#2FC25B'],
sizes: ['12px']
}}
>
<Axis
field="day"
Expand Down

0 comments on commit 4f2a3b5

Please sign in to comment.