esnet / react-timeseries-charts

Declarative and modular timeseries charting components for React
http://software.es.net/react-timeseries-charts
Other
856 stars 283 forks source link

Style the time in TimeMarker #474

Open shyam-asl opened 3 years ago

shyam-asl commented 3 years ago

🌈Feature request

What is this feature? Ability to style the time string in the TimeMarker.

How should the feature work? Just like the line and the info box and its labels, the time string should also be allowed to be styled to maintain a consistent styling.

Do you have examples or an idea of how it can be implemented? We can pass the style as an embedded object within infoStyle props, just like the others. In src/components/TimeMarker.js, we can pass an infoStyle.time style object:

    renderTimeMarker(d) {
        const textStyle = {
            fontSize: 11,
            textAnchor: "left",
            fill: "#bdbdbd",
            ...this.props.infoStyle.time // <-- new embedded prop
        };

Additional context The suggested style using infoStyle.time is based on the following styles used in TimeMarker: