fix: chart bug
This commit is contained in:
parent
d21e7c0edb
commit
8291706f9c
|
@ -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,
|
||||||
},
|
},
|
||||||
|
|
|
@ -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
|
|
||||||
name={`line${i}`}
|
|
||||||
//style={{ labels: { display: "none" } }}
|
|
||||||
//labels={() => null}
|
|
||||||
//labelComponent={<span></span>}
|
|
||||||
/>
|
|
||||||
{
|
|
||||||
<VictoryScatter
|
<VictoryScatter
|
||||||
//style={{ labels: { display: "none" } }}
|
//style={{ labels: { display: "none" } }}
|
||||||
size={({ active }) => (active ? 3.75 : 3)}
|
size={({ active }) => (active ? 3.75 : 3)}
|
||||||
//labels={() => null}
|
//labels={() => null}
|
||||||
//labelComponent={<span></span>}
|
//labelComponent={<span></span>}
|
||||||
/>
|
/>
|
||||||
// No idea how to disable labels
|
|
||||||
}
|
{/* Doesn't work well with tooltips
|
||||||
|
<VictoryLine
|
||||||
|
name={`line${i}`}
|
||||||
|
//style={{ labels: { display: "none" } }}
|
||||||
|
//labels={() => null}
|
||||||
|
//labelComponent={<span></span>}
|
||||||
|
/>
|
||||||
|
*/}
|
||||||
</VictoryGroup>
|
</VictoryGroup>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user