esnet / react-timeseries-charts

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

Increasing the Label fontSize of y-axis #427

Closed aruldd closed 4 years ago

aruldd commented 4 years ago

I want to increase the font-size fo the Y-axis label,

I have tried this :

<YAxis
  id="cop"
  label="CoP"
  min={0}
  max={15}
  width="50"
  type="linear"
  style={{
    label: {
      stroke: '1px',
      fill: 'blue', // Default label color
      fontWeight: 100,
      fontSize: 24,
      font: '"Goudy Bookletter 1911", sans-serif"',
    },
  }}
/>

But this changes only the colour of the legend. I am unable to see any of the other parameters passed to the text in the SVG.

Thank you for the help!

darkopetrovic commented 4 years ago

Using a CSS style seems working:

.yaxislabel {
  font-size: 14pt;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
}
Iman-Jamali commented 4 years ago

I have the same issue. CSS style worked though.

aruldd commented 4 years ago

Thank you, the CSS styling worked.

Oddisey commented 4 years ago

For anyone else who come's across this issue, you can solve it by using "font-size" instead of fontSize and "font-family" instead of font. Like so: label: { stroke: "#0d18b7", fontWeight: 100, "font-size": 20, "font-family": "Roboto" }