Skip to content

Unable to change font size, other styles #363

Open
@Trevin-Small

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions