Skip to content

Commit

Permalink
fix(website): fix xScale.type option for line chart
Browse files Browse the repository at this point in the history
Close #686
  • Loading branch information
wyze committed May 17, 2020
1 parent f3ba3f9 commit ad77a5f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion website/src/pages/line/index.js
Expand Up @@ -54,6 +54,21 @@ const initialProperties = {
motionDamping: 15,
}

const linearData = [
{
id: 'fake corp. A',
data: [
{ x: 0, y: 7 },
{ x: 1, y: 5 },
{ x: 2, y: 11 },
{ x: 3, y: 9 },
{ x: 4, y: 13 },
{ x: 7, y: 16 },
{ x: 9, y: 12 },
],
},
]

const Line = () => {
return (
<ComponentTemplate
Expand All @@ -71,7 +86,7 @@ const Line = () => {
{(properties, data, theme, logAction) => {
return (
<ResponsiveLine
data={data}
data={properties.xScale.type === 'linear' ? linearData : data}
{...properties}
theme={theme}
yFormat=".2f"
Expand Down

0 comments on commit ad77a5f

Please sign in to comment.