Commit 688cffa3 authored by alain's avatar alain 🐙
Browse files

chart tick adjustments

parent 6828d011
......@@ -200,16 +200,12 @@ class StationInfo extends React.Component {
<ComposedChart data={data} margin={{ top: 0, right: 30, left: 0, bottom: 10 }}>
<defs>
<linearGradient id="yaxis" x1="0" y1="0" x2="0" y2={chartHeight - 80} gradientUnits="userSpaceOnUse">
{
//Object.keys(unit.legend).sort((a,b) => b-a).map(s => <stop key={s} offset={`${(unit.range[1]-s)/unit.range[1] * 100}%`} stopColor={unit.legend[s].color} />)
Object.keys(unit.legend).sort((a,b) => b-a).map(s => <stop key={s} offset={`${100 - (yScale(s) * 100)}%`} stopColor={unit.legend[s].color} />)
}
{ Object.keys(unit.legend).sort((a,b) => b-a).map(s => <stop key={s} offset={`${100 - (yScale(s) * 100)}%`} stopColor={unit.legend[s].color} />) }
</linearGradient>
</defs>
<XAxis type="number" scale="time" domain={['auto', 'auto']} dataKey="timestamp" padding={{ left: 6 }} tickFormatter={this.xAxisTickFormatter} tickSize={4} ticks={this.state.xAxisTicks} />
<YAxis type="number" strokeWidth="6" stroke="url(#yaxis)" width={100} ticks={(unit.ticks ? unit.ticks : Object.keys(unit.legend))} height={chartHeight} domain={unit.range} tickSize={4} tickLine={{ strokeWidth: 1 }} allowDataOverflow={true} scale={yScale} />
{/* <YAxis scale="log" /> */}
<YAxis type="number" strokeWidth="6" stroke="url(#yaxis)" width={40} ticks={(unit.ticks ? unit.ticks : Object.keys(unit.legend))} height={chartHeight} domain={unit.range} tickSize={2} tickLine={{ strokeWidth: 1 }} allowDataOverflow={true} scale={yScale} />
<Tooltip content={ ChartTooltip } animationDuration={0} unit={unit.label} />
......
......@@ -50,7 +50,7 @@
.xAxis,
.yAxis {
text {
font-size: 13px;
font-size: 12px;
fill: #000;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment