fix: chart bug

This commit is contained in:
NunoSempere 2022-04-20 00:31:44 -04:00
parent d21e7c0edb
commit 8291706f9c
2 changed files with 9 additions and 9 deletions

View File

@ -56,12 +56,12 @@ async function fakeGetHistoryQuestionById(id) {
timestamp: `2022-04-${`0${x + 1}`.slice(-2)}T13:09:13.000Z`, timestamp: `2022-04-${`0${x + 1}`.slice(-2)}T13:09:13.000Z`,
options: [ options: [
{ {
name: "X", name: "Yes",
type: "PROBABILITY", type: "PROBABILITY",
probability: 0.0351 + Math.abs(Math.sin(3 * x)) / 2, probability: 0.0351 + Math.abs(Math.sin(3 * x)) / 2,
}, },
{ {
name: "Y", name: "No",
type: "PROBABILITY", type: "PROBABILITY",
probability: 0.9649 - Math.abs(Math.sin(3 * x)) / 2, probability: 0.9649 - Math.abs(Math.sin(3 * x)) / 2,
}, },

View File

@ -62,21 +62,21 @@ const colors = ["dodgerblue", "crimson", "seagreen", "darkviolet", "turquoise"];
const getVictoryGroup = (data, i) => { const getVictoryGroup = (data, i) => {
return ( return (
<VictoryGroup color={colors[i] || "darkgray"} data={dataAsXy(data)}> <VictoryGroup color={colors[i] || "darkgray"} data={dataAsXy(data)}>
<VictoryLine <VictoryScatter
name={`line${i}`}
//style={{ labels: { display: "none" } }} //style={{ labels: { display: "none" } }}
size={({ active }) => (active ? 3.75 : 3)}
//labels={() => null} //labels={() => null}
//labelComponent={<span></span>} //labelComponent={<span></span>}
/> />
{
<VictoryScatter {/* Doesn't work well with tooltips
<VictoryLine
name={`line${i}`}
//style={{ labels: { display: "none" } }} //style={{ labels: { display: "none" } }}
size={({ active }) => (active ? 3.75 : 3)}
//labels={() => null} //labels={() => null}
//labelComponent={<span></span>} //labelComponent={<span></span>}
/> />
// No idea how to disable labels */}
}
</VictoryGroup> </VictoryGroup>
); );
}; };