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

Area & Line charts have a huge margin on each side when i give them labels. #47

Closed
jimfilippou opened this issue Aug 22, 2018 · 1 comment

Comments

@jimfilippou
Copy link
Contributor

jimfilippou commented Aug 22, 2018

This configuration

{
  "chart": {
    "height": "360px",
    "width": "100%",
    "type": "area",
    "foreColor": "#fff"
  },
  "stroke": {
    "curve": "smooth"
  },
  "series": [
    {
      "name": "One",
      "data": [
        262,
        81,
        3
      ]
    },
    {
      "name": "Two",
      "data": [
        1,
        62,
        448
      ]
    }
  ],
  "title": {
    "text": "",
    "align": "left"
  },
  "legend": {
    "show": false
  },
  "grid": {
    "show": true,
    "borderColor": "transparent"
  },
  "xaxis": {
    "type": "categories",
    "categories": [
      "One",
      "Two",
      "Three"
    ]
  }
}

looks like this
sketch

However this configuration

{
  "chart": {
    "height": "360px",
    "width": "100%",
    "type": "area",
    "foreColor": "#fff"
  },
  "stroke": {
    "curve": "smooth"
  },
  "series": [
    {
      "name": "μεταβλητή-0",
      "data": [
        175,
        498,
        375
      ]
    },
    {
      "name": "μεταβλητή-1",
      "data": [
        268,
        385,
        352
      ]
    }
  ],
  "title": {
    "text": "",
    "align": "left"
  },
  "legend": {
    "show": false
  },
  "grid": {
    "show": true,
    "borderColor": "transparent"
  },
  "xaxis": {
    "type": "categories",
    "categories": []
  }
}

The chart looks like this
sketch2

Note that on the second chart, the third label is hidden.
I want the margins to shorten or disappear, what should I do? 🤔

@junedchhipa
Copy link
Contributor

Hi @jimfilippou
I am sorry, there's not an easy way currently to prevent the spacings.

Because there is a difference in how the numeric charts and category charts are calculated.
Other charts (highcharts example) follows the same too.

Regarding the last label disappearing - I have fixed it. Will push the next release soon.

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