Skip to content

[Bug]: Diff tooltips prefix option #688

Open

Description

@rodrigorz

Would you like to work on a fix?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

Current and expected behavior

Currently the old data tooltip is not displaying correctly, se the image below:

image

The '&' character present in the old data tooltip (gray) is from index 1 of the new data tooltip (blue). If the new data tooltip is "LAbel", the old data tooltip will be 'A'.

To reproduce: codesandbox

Add these options to Chart at App.tsx:

      options={{
        diff: {
          oldData: {
            tooltip: {
              prefix: 'OLD',
            },
          },
          newData: {
            tooltip: {
              prefix: 'L&bel 2',
            },
          },
        },
      }}

Reproduction

https://codesandbox.io/s/github/RakanNimer/react-google-charts/tree/master/sandboxes/column-chart/diff?from-embed=&file=/App.tsx:531-787

react-google-charts version

v4.0.0

Possible solution

Check the logic of the old data tooltip to get from the option diff.oldData.tooltip.prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions