TanStack / react-charts

⚛️ Simple, immersive & interactive charts for React
https://react-charts.tanstack.com
MIT License
2.98k stars 243 forks source link

Unable to change font size, other styles #363

Open Trevin-Small opened 8 months ago

Trevin-Small commented 8 months ago

I am using the latest version of react-charts, 3.0.0-beta.57

I'm attempting to change the styling options of the tags used for the ticks on the graph axes.

Based on this type definition of AxisOptions, there is styles field which can be changed.

export declare type AxisOptionsBase = {
    ....
    styles?: CSSProperties & {
        line?: CSSProperties;
        tick?: CSSProperties;
    };
};

I have attempted to set the tick font size via the following:

  const primaryAxis = useMemo(
    (): AxisOptions<ChartSubmissionDatum> => ({
      getValue: datum => datum.date,
      styles: {
        tick: {fontSize:20}
      },
    }),
    []
  );

However, this style is not being applied to the ticks. Further, I have been unable to change other CSS properties such as color, font family. Is this feature supported? None of the example code makes use of this style object and the documentation does not mention anything about it.