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
Hello! I'm having an issue and I didn't want to file a bug until I ask here and understand how things are supposed to work.
I'm looking to use CSS classes instead of fill/stroke properties directly for the coloring of chart elements to help standardize the designs with the rest of my app.
It seems like this is intended to be supported since the class is passed through from the <ReferenceLine..> element down to the underlying SVG code. The problem I'm seeing is that it doesn't go to the right place.
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
-
Hello! I'm having an issue and I didn't want to file a bug until I ask here and understand how things are supposed to work.
I'm looking to use CSS classes instead of fill/stroke properties directly for the coloring of chart elements to help standardize the designs with the rest of my app.
For example, I'd prefer to replace
<ReferenceLine y={0} stroke="#F26464" width={2} />
with
<ReferenceLine y={0} className="stroke-crimson" width={2} />
and
.stroke-crimson{ stroke: #F26464; }
It seems like this is intended to be supported since the class is passed through from the
<ReferenceLine..>
element down to the underlying SVG code. The problem I'm seeing is that it doesn't go to the right place.My intended recharts code renders down to this:
Note that the "stroke-crimson" class has been applied to the
<g>
tag and not to the<line>
element.Manually changing the code with browser inspect and moving the class down to the
<line>
element produces the desired effect.Is this a bug, or is there another way I am supposed to be doing what I want to, or is what I want to do not supported?
I'm using tailwindcss if that somehow matters.
Thanks for any feedback!
Beta Was this translation helpful? Give feedback.
All reactions