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

How to get the same design as the website example? #414

Closed
hallefsantos opened this issue May 25, 2023 · 2 comments
Closed

How to get the same design as the website example? #414

hallefsantos opened this issue May 25, 2023 · 2 comments

Comments

@hallefsantos
Copy link

hallefsantos commented May 25, 2023

I'd want the design just like the website (white tooltips, the legend, etc), is there a way to change the theme?

I'm using exactly the same code that frappe provides.

let chart = new Chart( "#frost-chart", {
      data: {
      labels: ["12am-3am", "3am-6am", "6am-9am", "9am-12pm",
        "12pm-3pm", "3pm-6pm", "6pm-9pm", "9pm-12am"],

      datasets: [
        {
          name: "Some Data", chartType: 'bar',
          values: [25, 40, 30, 35, 8, 52, 17, -4]
        },
        {
          name: "Another Set", chartType: 'bar',
          values: [25, 50, -10, 15, 18, 32, 27, 14]
        },
        {
          name: "Yet Another", chartType: 'line',
          values: [15, 20, -3, -15, 58, 12, -17, 37]
        }
      ],

      yMarkers: [{ label: "Marker", value: 70,
        options: { labelPos: 'left' }}],
      yRegions: [{ label: "Region", start: -10, end: 50,
        options: { labelPos: 'right' }}]
      },

      title: "My Awesome Chart",
      type: 'axis-mixed', // or 'bar', 'line', 'pie', 'percentage'
      height: 300,
      colors: ['purple', '#ffa3ef', 'light-blue'],

      tooltipOptions: {
        formatTooltipX: d => (d + '').toUpperCase(),
        formatTooltipY: d => d + ' pts',
      }
    })

Expected Behaviour

Screenshot 2023-05-25 at 08 50 59

Actual Behaviour

Screenshot 2023-05-25 at 08 55 01 Screenshot 2023-05-25 at 08 55 47

Frappé Charts version: 1.6.2

https://codesandbox.io/s/frappe-charts-demo-viqud?from-embed=&file=/src/index.js

@hallefsantos hallefsantos changed the title How to get the same design as website' example? How to get the same design as the website example? May 25, 2023
@uhrjun
Copy link
Member

uhrjun commented May 26, 2023

The website uses a V2 release RC version found at https://unpkg.com/browse/frappe-charts@2.0.0-rc23/ also upstreamed in this repo. The NPM package is a bit outdated. The newer version ships a newer stylesheet, while containing some breaking changes that don't have an easy-to-read documentation yet. So you might need to scour this repo if you face some issues.

@hallefsantos
Copy link
Author

Thank you @uhrjun

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

2 participants