react-vis
react-vis copied to clipboard
draw chart doesn't happen properly

i am receiving from api x y like this
{
x: "2019-10-20T01:17:56.000Z",
y: 22.22
},
- i tried to set xType="time" but doesn't show any thing
- drawing the chart not happen properly as u see in tooltip current value is 20 but drawing the chart on 40 !!!
- hint without x key doesn't move on mouse change position
<FlexibleXYPlot
height="125"
xType="ordinal"
onMouseLeave={() => this.setState({ hoverValue: false })}
>
<HorizontalGridLines style={{ stroke: "#f0f0f0" }} />
<XAxis
style={{
line: { stroke: "#f0f0f0" },
ticks: { paddingLeft: 10, stroke: "none" },
text: {
stroke: "none",
fill: "#919191",
fontWeight: 500,
fontSize: 8,
}
}}
hideLine
tickFormat={d => moment(d).format("LT").split(' ')[0]}
tickSize={0}
tickSizeInner={0}
tickSizeOuter={0}
tickTotal={8}
/>
<YAxis
attr="y"
orientation="left"
tickTotal={8}
tickValues={[0, 10, 20, 30, 40]}
yDomain={[0, 40]}
tickSize={0}
style={{
ticks: { stroke: "#f0f0f0" },
text: {
stroke: "none",
fill: "#919191",
fontWeight: 500,
fontSize: 8,
fontFamily: "Roboto"
}
}}
tickFormat={tick => {
return tempConverter(tick);
}}
/>
<LineSeries
color="#BBBBBB"
curve={null}
opacity={1}
animation={animation}
style={{ fill: "none", weight: 500, strokeWidth: 1 }}
getNull={d => d.y !== null}
{...LineSeriesProps}
/>
{hoverValue ? (
<Hint
value={buildValue(hoverValue)}
style={{
display: "flex",
backgroundColor: "#919191",
padding: 7,
borderRadius: 5,
boxShadow: "1px 1px 9px 0 rgba(0,0,0,0.22)",
color: "#fff",
fontSize: 11,
transform: 'translate(-200%, -250%)',
}}
className={hint}
align={{vertical: 'top', horizontal: 'left'}}
/>
) : null}
</FlexibleXYPlot>