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

Bar Chart > Bar alignment issue #605

Open
harshraghavani24 opened this issue May 27, 2024 · 1 comment
Open

Bar Chart > Bar alignment issue #605

harshraghavani24 opened this issue May 27, 2024 · 1 comment

Comments

@harshraghavani24
Copy link

harshraghavani24 commented May 27, 2024

I am having a strange issue, in my local my bar chart alignment is proper it is starting from zero but in the test server it is not showing properly i am attaching the images for this issue

Here is my code for the data and series

` const data = {
series: chartData.data.map((item) => {
return {
name: item?.name,
data: item?.data,
};
}),

options: {
  chart: {
    rtl: i18n.language === LANGUAGE_AR ? true : false,
    height: 'auto',
    type: 'bar',
    toolbar: {
      show: false,
    },
    zoom: {
      enabled: true,
      type: 'y',
    },
  },
  plotOptions: {
    bar: {
      columnWidth: '30px',
      borderRadius: 5,
      borderRadiusApplication: 'top',
    },
  },

  // Bars Colors
  colors: getColors,

  states: {
    hover: {
      filter: {
        type: 'darken',
        value: 0.7,
      },
    },
  },

  // X Axis
  xaxis: {
    categories: chartData.labels,
    position: 'bottom',
    axisBorder: {
      show: true,
    },
    axisTicks: {
      show: false,
    },
    labels: {
      show: true,
      style: {
        fontSize: '16px',
        fontWeight: 700,
        fontFamily: 'SourceSansPro, sans-serif',
      },
    },
  },

  dataLabels: {
    enabled: false,
  },

  // Y Axis
  yaxis: {
    opposite: i18n.language === LANGUAGE_AR ? true : false,
    axisBorder: {
      show: true,
    },
    axisTicks: {
      show: false,
    },
    labels: {
      formatter: function (value) {
        return value >= 0 ? value : `(${Math.abs(value)})`;
      },
      align: i18n.language === LANGUAGE_AR ? 'center' : 'left',
      style: {
        fontSize: '16px',
        fontWeight: 700,
        fontFamily: 'SourceSansPro, sans-serif',
      },
    },
  },

  stroke: {
    show: true,
    width: 15,
    colors: ['transparent'],
  },

  // Tooltip
  tooltip: {
    enabled: true,
    theme: 'light',
    style: {
      fontSize: '14px',
    },
    highlightDataSeries: true,
    marker: {
      show: true,
    },
  },

  // bottom labels
  legend: {
    show: false,
  },

  // Responsive
  responsive: [
    {
      breakpoint: 1000,
      options: {
        plotOptions: {
          bar: {
            columnWidth: '30px',
            rangeBarOverlap: true,
            rangeBarGroupRows: false,
          },
          stroke: {
            colors: ['transparent'],
            width: 5,
          },
        },
        xaxis: {
          categories: chartData.labels,
          position: 'bottom',
          axisBorder: {
            show: true,
          },
          axisTicks: {
            show: false,
          },
          labels: {
            show: true,
            style: {
              fontSize: '14px',
              fontWeight: 700,
              fontFamily: 'SourceSansPro, sans-serif',
            },
          },
        },
        yaxis: {
          opposite: i18n.language === LANGUAGE_AR ? true : false,
          axisBorder: {
            show: true,
          },
          axisTicks: {
            show: false,
          },
          labels: {
            formatter: function (value) {
              return value >= 0 ? value : `(${Math.abs(value)})`;
            },
            align: i18n.language === LANGUAGE_AR ? 'center' : 'left',
            style: {
              fontSize: '14px',
              fontWeight: 700,
              fontFamily: 'SourceSansPro, sans-serif',
            },
          },
        },
      },
    },
  ],
},

};`

I haven't added any external CSS

Test Server:
Screenshot 2024-05-27 at 1 15 41 PM

Local:
Screenshot 2024-05-27 at 1 16 52 PM

Copy link

github-actions bot commented Aug 2, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant