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

Fixing Incorrect GridLine Intervals in Chart X and Y Axes #4037

Closed
SubinAdhikariEverWorks opened this issue Oct 3, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@SubinAdhikariEverWorks
Copy link

Description

The chart X interval and Y Interval GridLine is not correct

Steps to Reproduce

  1. https://codepen.io/SubinAdhikariEverWorks/pen/PoXajEe This is the correct Chart
  2. https://codepen.io/SubinAdhikariEverWorks/pen/eYbKReY This is the one with Bug
  3. the TWO and ONLY TWO difference between 1 and 2 is
    a. Series Data X value Starts with 4000 instead of 1
    b. xaxis.min and xaxis.max is removed because having value as
    "min": 4000, "max": 4349,
    would not generate any chart at all.
  4. This is the TEXT COMPARE results https://www.textcompare.org/?id=651c17c71949f6c64664279d ( will work for 1 year )

Expected Behavior

The Grid Lines Should have been just like the Correct Graph

Actual Behavior

The Grid Lines are not correct.

Screenshots

  1. Bug Screenshot
    image
    Correct Screen Shot
    image

Reproduction Link

  1. https://codepen.io/SubinAdhikariEverWorks/pen/PoXajEe This is the correct Chart
  2. https://codepen.io/SubinAdhikariEverWorks/pen/eYbKReY This is the one with Bug
@SubinAdhikariEverWorks SubinAdhikariEverWorks added the bug Something isn't working label Oct 3, 2023
@aaditya129
Copy link

aaditya129 commented Oct 3, 2023

I've made some improvements to the ApexCharts configuration to enhance the X-axis representation in the chart:

  • Added tickPlacement: "between" to align ticks between data points, providing a more precise representation of data.

  • Set min to 4000 and max to 4349 for the X-axis to specify a custom range that suits the data I'm visualizing.

    xaxis: {
    title: {
    text: "Coil",
    align: "center"
    },
    tickAmount: 13,
    tickPlacement: "between",
    min: 4000,
    max: 4349,
    type: 0,
    decimalsInFloat: 1,
    convertedCatToNumeric: true
    }
    https://codepen.io/aaditya129/pen/jOXvJwZ

These updates have resolved the issues and improved the chart's readability. Please feel free to review and provide feedback.
@SubinAdhikariEverWorks

@SubinAdhikariEverWorks
Copy link
Author

@aaditya129 Indeed, tickPlacement Solved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants