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

Line Chart without shading #33

Closed
GrahamJohnWhite opened this issue Nov 21, 2019 · 3 comments
Closed

Line Chart without shading #33

GrahamJohnWhite opened this issue Nov 21, 2019 · 3 comments

Comments

@GrahamJohnWhite
Copy link

Hi,

I am new to this but have managed to create a line chart with the code below, however, when it creates the chart there is shading from the lien to the x-axes. I don't want any shading at all just the lines. How do I achieve this?

@GrahamJohnWhite GrahamJohnWhite changed the title Line Chart without shadin Line Chart without shading Nov 21, 2019
@typpo
Copy link
Owner

typpo commented Nov 21, 2019

Hey @GrahamJohnWhite, could you please paste the chart config again? It looks like it didn't paste correctly in the original.

@GrahamJohnWhite
Copy link
Author

chart?c={type:'line',data:{labels:['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21'], datasets:[{label:'Target',data:[28152,56304,84456,140760,197064,225216,253368,281520,309672,337824,365976,394128,422280,450432,478584,506736,534888,563040,591192]},{label:'Actual',data:[26657,48757,82028,159596,185229,216206,243242,275549,310121,336515,364990,386965,432594]},{label:'Last Year',data:[27806,55612,83418,111224,139030,166836,194642,222448,250254,278060,305866,333672,361478,389284,417090,444896,472702,500508,528314,556120,583926]}]},options:{title: {display: true,text: 'MTD Commission'}}}

@typpo
Copy link
Owner

typpo commented Nov 21, 2019

This question is actually about Chart.js, not QuickChart. Per the Chart.js documentation you can set fill: false for each dataset.

image

{
  "type": "line",
  "data": {
    "labels": [
      "1",
      "2",
      "3",
      "4",
      "5",
      "6",
      "7",
      "8",
      "9",
      "10",
      "11",
      "12",
      "13",
      "14",
      "15",
      "16",
      "17",
      "18",
      "19",
      "20",
      "21"
    ],
    "datasets": [
      {
        "label": "Target",
        "fill": false,
        "data": [
          28152,
          56304,
          84456,
          140760,
          197064,
          225216,
          253368,
          281520,
          309672,
          337824,
          365976,
          394128,
          422280,
          450432,
          478584,
          506736,
          534888,
          563040,
          591192
        ]
      },
      {
        "label": "Actual",
        "fill": false,
        "data": [
          26657,
          48757,
          82028,
          159596,
          185229,
          216206,
          243242,
          275549,
          310121,
          336515,
          364990,
          386965,
          432594
        ]
      },
      {
        "label": "Last Year",
        "fill": false,
        "data": [
          27806,
          55612,
          83418,
          111224,
          139030,
          166836,
          194642,
          222448,
          250254,
          278060,
          305866,
          333672,
          361478,
          389284,
          417090,
          444896,
          472702,
          500508,
          528314,
          556120,
          583926
        ]
      }
    ]
  },
  "options": {
    "title": {
      "display": true,
      "text": "MTD Commission"
    }
  }
}

@typpo typpo closed this as completed Nov 21, 2019
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