Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change font size, other styles #363

Open
Trevin-Small opened this issue Feb 26, 2024 · 0 comments
Open

Unable to change font size, other styles #363

Trevin-Small opened this issue Feb 26, 2024 · 0 comments

Comments

@Trevin-Small
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant