You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to build a chart with 2 Y-Axis. I first looked at the example which is both "number" values as the formats are the same. I am trying to build this view as part of a dropdown option of multiple data points (This is the only one with 2 Y-axis):
// Check if we need a second Y-axis (for PURSUITS/SACCADES)consthasSecondAxis=data[0]?.goal2Min!==undefined&&data[0]?.goal2Max!==undefined;constyAxis: YAxisInputProps<VictoryVisionDataPoint,'value'|'value2'>[]=[{
...CHART_STYLES.axis,linePathEffect: <DashPathEffectintervals={[5,5]}/>,
font,yKeys: ['value'asconst],},];if(hasSecondAxis){yAxis.push({axisSide: 'right'asconst,
...CHART_STYLES.axis,linePathEffect: <DashPathEffectintervals={[5,5]}/>,
font,yKeys: ['value2'asconst],});}return(<CartesianChartdata={data}padding={{bottom: 16}}domainPadding={CHART_STYLES.domainPadding}xKey="x"yKeys={['value','value2']}frame={CHART_STYLES.frame}domain={{y: [0,Math.round(maxY*1.01)],x: [startDate,endDate],}}xAxis={{
...CHART_STYLES.axis,
font,lineWidth: 0,formatXLabel: (value: number)=>formatXAxisLabel(value,dateRangeType),}}yAxis={yAxis}>...
</CartesianChart>);
i set my yKeys={['value', 'value2']} to read the data. However, the ticks are about the same on both left & right sides - except for the right side first tick value:
Do I need to handle the domain differently when they are different types (number v percent)?
I technically need the ticks on the right side to be reversed...but the values of the ticks don't need to be exact.
can I get away without typing the number of ticks & tick values?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to build a chart with 2 Y-Axis. I first looked at the example which is both "number" values as the formats are the same. I am trying to build this view as part of a dropdown option of multiple data points (This is the only one with 2 Y-axis):
i set my
yKeys={['value', 'value2']}
to read the data. However, the ticks are about the same on both left & right sides - except for the right side first tick value:domain
differently when they are different types (number v percent)?Beta Was this translation helpful? Give feedback.
All reactions