|
| 1 | +# Chart Studio HTML Template |
| 2 | + |
| 3 | +Host your HTML charts online for free using GitHub Pages. This template makes it easy to publish your visualizations and share them with a simple web link. |
| 4 | + |
| 5 | +## What This Does |
| 6 | + |
| 7 | +Upload your HTML chart files, and each one gets its own web address that you can share with anyone. For example: |
| 8 | +- `my-chart.html` becomes `https://yourusername.github.io/your-project/my-chart.html` |
| 9 | + |
| 10 | +## Step-by-Step Guide |
| 11 | + |
| 12 | +### Step 1: Create Your Own Copy |
| 13 | + |
| 14 | +1. At the top of this page on GitHub, click the green **"Use this template"** button |
| 15 | +2. Give your project a name (like "my-charts") |
| 16 | +3. Click **"Create repository"** |
| 17 | + |
| 18 | +### Step 2: Turn On GitHub Pages |
| 19 | + |
| 20 | +This is the most important step - your charts won't be published without it! |
| 21 | + |
| 22 | +1. In your new repository, click **Settings** at the top |
| 23 | +2. Look in the left sidebar and click **Pages** |
| 24 | +3. Under "Build and deployment", find the **Source** dropdown |
| 25 | +4. Select **GitHub Actions** (not "Deploy from a branch") |
| 26 | +5. The page will refresh - you're all set! |
| 27 | + |
| 28 | +### Step 3: Add Your Chart Files |
| 29 | + |
| 30 | +You can add files directly on GitHub (easiest) or use GitHub Desktop: |
| 31 | + |
| 32 | +**Option A: Upload on GitHub (Easiest)** |
| 33 | +1. Click on the `charts` folder |
| 34 | +2. Click **Add file** → **Upload files** |
| 35 | +3. Drag and drop your `.html` files |
| 36 | +4. Click **Commit changes** at the bottom |
| 37 | + |
| 38 | +**Option B: Using GitHub Desktop** |
| 39 | +1. Download [GitHub Desktop](https://desktop.github.com/) |
| 40 | +2. Clone your repository to your computer |
| 41 | +3. Copy your `.html` files into the `charts` folder |
| 42 | +4. In GitHub Desktop, write a description and click **Commit to main** |
| 43 | +5. Click **Push origin** to upload |
| 44 | + |
| 45 | +### Step 4: Wait for Publishing |
| 46 | + |
| 47 | +After uploading files: |
| 48 | +1. Click the **Actions** tab at the top of your repository |
| 49 | +2. You'll see a workflow running (yellow dot = in progress, green check = done) |
| 50 | +3. This usually takes 30-60 seconds |
| 51 | + |
| 52 | +### Step 5: View Your Charts Online |
| 53 | + |
| 54 | +Your charts are now live! The web address follows this pattern: |
| 55 | + |
| 56 | +``` |
| 57 | +https://YOUR-USERNAME.github.io/YOUR-REPO-NAME/FILENAME.html |
| 58 | +``` |
| 59 | + |
| 60 | +**Example:** |
| 61 | +- If your GitHub username is `jane-smith` |
| 62 | +- Your repository is named `my-charts` |
| 63 | +- You uploaded `sales-report.html` |
| 64 | +- Your chart is at: `https://jane-smith.github.io/my-charts/sales-report.html` |
| 65 | + |
| 66 | +## Finding Your Chart URLs |
| 67 | + |
| 68 | +Don't remember the exact address? |
| 69 | + |
| 70 | +1. Go to **Settings** → **Pages** |
| 71 | +2. At the top you'll see "Your site is live at [address]" |
| 72 | +3. Add your filename to the end: `[address]/your-file.html` |
| 73 | + |
| 74 | +## Adding More Charts |
| 75 | + |
| 76 | +Just repeat Step 3! Every time you add a new `.html` file to the `charts` folder and commit it, GitHub will automatically publish it within about a minute. |
| 77 | + |
| 78 | +## Troubleshooting |
| 79 | + |
| 80 | +**My chart isn't showing up** |
| 81 | +- Double-check that GitHub Pages is enabled (Settings → Pages → Source should say "GitHub Actions") |
| 82 | +- Make sure your file is in the `charts` folder, not somewhere else |
| 83 | +- Wait 1-2 minutes after uploading - it's not instant |
| 84 | +- Check the Actions tab to see if there were any errors (red X icon) |
| 85 | + |
| 86 | +**I see a 404 error** |
| 87 | +- Make sure you're using the exact filename (including `.html`) |
| 88 | +- Check that the file name doesn't have spaces - use dashes instead (`my-chart.html` not `my chart.html`) |
| 89 | + |
| 90 | +**Need to remove a chart?** |
| 91 | +- Go to the `charts` folder, click on the file, and click the trash icon |
| 92 | +- Commit the change, and it will be removed from your site within a minute |
0 commit comments