Closed yassinedorbozgithub closed 2 years ago
@yassinedorbozgithub There's a simpler solution for this after the refactoring i've made. You could alter the x coordinate in shapeDatum
, in LineColumnChart
recipe you do the following :
<Points
xDomainKey={xAxis.domainKey}
yDomainKey={yLineAxis.domainKey}
scopedSlots={{
default: ({ shapeData, scales: { xScale } }) => {
const bandwidth = xScale.scale.bandwith();
const centeredShapeData = shapeData.map((shapeDatum) => ({ ...shapeDatum, x: shapeDatum.x + bandwidth / 2 }))
return (
<g className="ez-line">
<LinePath
shapeData={centeredShapeData}
curve={line.curve}
beta={line.beta}
stroke={line.stroke}
strokeWidth={line.strokeWidth}
/>
{!marker.hidden &&
centeredShapeData.map((pointDatum) => {
return (
<Point
key={pointDatum.id}
shapeDatum={pointDatum}
r={marker.radius}
stroke={marker.color}
fill={marker.color}
strokeWidth={line.strokeWidth}
/>
);
})}
</g>
);
},
}}
/>
I suggest we close this PR since there's a lot of conflicts due to the changes I've made. (sorry)
So let's open a new one :)
Motivation
This PR fixes the LineColumnChart to have centred points (Vue).
Fixes #43
Type of change
Please delete options that are not relevant.
Checklist: