wuxudong / react-native-charts-wrapper

a react native charts wrapper (support android & iOS)
2.43k stars 657 forks source link

xAxis and yAxis not show labels in Barchart #909

Open mMarcos208 opened 1 year ago

mMarcos208 commented 1 year ago

Expected Behavior

show labels

Actual Behavior

not show labels

Screenshots

Old ScreenShot

image

Actual Screenshot

image

Data and config


const barChartData = [{"y": 203}, {"y": 614}, {"y": 413}, {"y": 907}, {"y": 1196}, {"y": 164}]

const xAxisProps: xAxis = {
  valueFormatter: ['0-100', '101-200', '201-300', '301-400', '401-500', '> 500'],
  granularityEnabled: true,
  granularity: 1,
  drawGridLines: false,
  position: 'BOTTOM',
  textSize: 11,
}

const yAxisProps: {
  left?: yAxis
  right?: yAxis
} = {
  left: {drawGridLines: false, textSize: 11, axisMinimum: 0},
  right: {drawGridLines: false, drawLabels: false, axisMinimum: 0},
}

const chartDescription: ChartDescription = {text: ''}

const legend: ChartLegend = {
  enabled: false,
}

const configBarChart: BarDatasetConfig = {
  color: processColor(colors.silverTree),
  barShadowColor: processColor(colors.silverTree),
  highlightAlpha: 90,
  highlightColor: processColor(colors.silverTree),
  valueTextSize: 10,
}

<BarChart
              style={summaryFarmBarChartStyles.chart}
              data={{
                dataSets: [
                  {
                    values: barChartData,
                    label: '',
                    config: configBarChart,
                  },
                ],
                config: {
                  barWidth: 0.7,
                },
              }}
              legend={legend}
              xAxis={xAxisProps}
              yAxis={yAxisProps}
              scaleEnabled={false}
              drawValueAboveBar
              pinchZoom
              doubleTapToZoomEnabled
              chartDescription={chartDescription}
            />

Steps to Reproduce the Problem

Specifications

Guilleanto commented 1 year ago

are you trying changing the theme of the iphone?

mMarcos208 commented 1 year ago

@Guilleanto no.