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

How to change color on xaxis labels on grouped bar chart? #39

Closed
jimfilippou opened this issue Aug 16, 2018 · 3 comments
Closed

How to change color on xaxis labels on grouped bar chart? #39

jimfilippou opened this issue Aug 16, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@jimfilippou
Copy link
Contributor

jimfilippou commented Aug 16, 2018

sketch
How to change xaxis labels colors?
I'm using this configuration

const options = {
	chart: {
      height: 200,
      type: 'bar',
    },
    plotOptions: {
      bar: {
        horizontal: true
      }
    },
    dataLabels: {
      enabled: false,
    },
    stroke: {
      show: false,
      width: 1,
      colors: ['#fff']
    },
    series: [{
      name: 'Competition',
      data: [44, 55, 41, 64, 20]
    }, {
      name: 'Me',
      data: [53, 32, 33, 52, 10]
    }],
    colors: ['#F47B20', '#005596'],
    legend: {
      show: false,
      position: 'top'
    },
    grid: {
      show: false
    },
    xaxis: {
      categories: ['Alpha bank', 'Eurobank', 'Τράπεζα πειραιώς', 'Εθνική τράπεζα', 'Attica Bank'],
      labels: {
        show: true,
        style: {
          color: 'blue',
          fontSize: '12px'
        },
      }
    }
}
@junedchhipa
Copy link
Contributor

I think I missed the labels color settings for "Horizontal Bar Charts".
I will take a look

@junedchhipa junedchhipa added the bug Something isn't working label Aug 16, 2018
@junedchhipa
Copy link
Contributor

Fixed the x-axis color setting which I missed for bar charts
Note that the name of the property is changed from color to colors xaxis.labels.style.colors
It accepts an array as well as a single string color. Here is the doc - https://apexcharts.com/docs/options/xaxis/#labelsColor

@nareshpatil031886
Copy link

Screenshot (3)
here i am passed 8 color for each data item but its only show first 4 color for both bar 1 and bar 2 i want to 4 colors for 1st bar and another 4 color for second bar please give me the solution const ebChartData = {
series: [
{
data: [17, 11],
name: "PRODUCT A",
},
{
data: [17,11],
name: 'PRODUCT B',
},
{
data: [17, 11],
name: "PRODUCT C",
},
{
data: [11, 17],
name: 'PRODUCT D',
},
],
colors: ["#B7A0E0", "#EC99C2", "#FEBF89", "#FFE083","#C4F9CA", "#A3C4F3", "#98F5E1", "#FDE4CF"],
chart: {
type: "bar",
stacked: true,
toolbar: {
show: false,
},
},
xaxis: {
categories: ["Assets", "Liabilities & Equity"],
},
fill: {
opacity: 1,
},
legend: {
show: false,
},
plotOptions: {
bar: {

      horizontal: false,
      borderRadius:  10,
      borderRadiusApplication: "end",
      borderRadiusWhenStacked: "last",
      
    },
  },

};

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