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

Embedding chart without filter: 404 not found #233

Open
hendralinux opened this issue Oct 24, 2024 · 1 comment
Open

Embedding chart without filter: 404 not found #233

hendralinux opened this issue Oct 24, 2024 · 1 comment

Comments

@hendralinux
Copy link

I created a dashboard without the need for any filter, however it seems like the url to be used as src in iframe requires a filter as in ../chart-name/embed?filter_name=value coz simply using ../chart-name/embed or even ./chart-name/embed?dummy returns 404 error.

From sample metadata:

<iframe
  src="/-/dashboards/my-dashboard/my-chart/embed?start_date=2023-01-01&end_date=2023-12-31"
  frameborder="0"
  width="100%"
  height="600"
  allowtransparency
>
</iframe>
@rclement
Copy link
Owner

@hendralinux: sorry but I cannot reproduce your issue. Could you provide a minimal reproducible sample (metadata.yml, html template) for the issue you are experiencing?

FYI, I tried to reproduce the issue with a minimal example:

  • For instance here is a basic dashboard without any filters containing a single chart:
  datasette-dashboards:
    test-dashboard:
      title: Test Dashboard
      description: Some description
      charts:
        test-chart:
          title: Total number of offers
          db: jobs
          query: >-
            SELECT count(*) as count
            FROM offers_view
          library: metric
          display:
            field: count
            prefix:
            suffix: " offers"
  • And then in a HTML template, an iframe to embedded the chart:
  <iframe
    src="/-/dashboards/test-dashboard/test-chart/embed"
    frameborder="0"
    width="100%"
    height="600"
    allowtransparency
  >
  </iframe>
  • This is working well on my end, without any 404 errors.

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