react-gifted-charts
Version:
ReactJS counterpart of react-native-gifted-charts. An intuitive charting library for Bar, Line, Area, Pie, Donut, Stacked Bar, Population Pyramid and Radar charts in React
20 lines • 1.2 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
export var renderSpecificVerticalLines = function (props) {
var data = props.data, barWidth = props.barWidth, yAxisLabelWidth = props.yAxisLabelWidth, initialSpacing = props.initialSpacing, spacing = props.spacing, containerHeight = props.containerHeight, lineConfig = props.lineConfig, maxValue = props.maxValue;
return data.map(function (item, index) {
if (item.showVerticalLine) {
var currentBarWidth = item.barWidth || barWidth || 30;
return (_jsx("rect", { x: yAxisLabelWidth +
6 -
(item.verticalLineThickness || 1) / 2 -
1 -
(initialSpacing - currentBarWidth / 2) +
(currentBarWidth + spacing) * index, y: containerHeight -
lineConfig.shiftY -
(item.value * containerHeight) / maxValue +
9, width: item.verticalLineThickness || 1, height: (item.value * containerHeight) / maxValue + lineConfig.shiftY, fill: item.verticalLineColor || 'lightgray' }));
}
return null;
});
};
//# sourceMappingURL=renderSpecificVerticalLines.js.map