TanStack / react-charts

⚛️ Simple, immersive & interactive charts for React

Home Page:https://react-charts.tanstack.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to change font size, other styles

Trevin-Small opened this issue · comments

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.